You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
I find the behavior of
str.split
a bit odd, and it should by default just return aDataFrame
(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)The text was updated successfully, but these errors were encountered: