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
Not sure if this is an issue in my setup or the intended behavior, but str.split behavior with multi-character patterns changed between 0.9.0 and 0.9.1, most likely due to #2119. Here is the original behavior going back to 0.8.1 as best I can tell.
In [1]: pd.__version__
Out[1]: '0.9.1.dev-c252129'
In [2]: s = pd.Series(["D0->D2"])
In [3]: s.str.split("->")
Out[3]: 0 [D0, D2]
In 0.9.1:
In [1]: pd.__version__
Out[1]: '0.9.1'
In [2]: s = pd.Series(["D0->D2"])
In [3]: s.str.split("->")
Out[3]: 0 [D0->D2]
Setting n=0 restores the behavior, on my Python install at least.
In [5]: s.str.split("->", n=0)
Out[5]: 0 [D0, D2]
Reproducible in 0.10.0b1.
In [1]: pd.__version__
Out[1]: '0.10.0b1'
In [2]: s = pd.Series(["D0->D2"])
In [3]: s.str.split("->")
Out[3]: 0 [D0->D2]
Dug a little and found that str.split and re.split treat maxsplit differently: str.split returns all splits when maxsplit is -1, while re.split does the same when maxsplit is 0.
Not sure if this is an issue in my setup or the intended behavior, but str.split behavior with multi-character patterns changed between 0.9.0 and 0.9.1, most likely due to #2119. Here is the original behavior going back to 0.8.1 as best I can tell.
In 0.9.1:
Setting n=0 restores the behavior, on my Python install at least.
Reproducible in 0.10.0b1.
Python 2.7.2+ (default, Jul 20 2012, 22:12:53)
[GCC 4.6.1] on linux2
Any thoughts on changing the default n for str.split back to 0?
Many thanks!
The text was updated successfully, but these errors were encountered: