Closed
Description
I find the behavior of str.split
a bit odd, and it should by default just return a DataFrame
(or maybe have a new function / option). Its straightforward to coerce it, but could/should be done internally.
(and str.extract
does return a DataFrame IIRC)
In [22]: s
Out[22]:
0 apple
1 apple, orange
2 orange
dtype: object
In [23]: s.str.split(',\s+')
Out[23]:
0 [apple]
1 [apple, orange]
2 [orange]
dtype: object
In [24]: s.str.split(',\s+').apply(Series)
Out[24]:
0 1
0 apple NaN
1 apple orange
2 orange NaN