Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API/BUG: Index.str.split(expand=True) not nan-safe #23677

Closed
h-vetinari opened this issue Nov 13, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@h-vetinari
Copy link
Contributor

commented Nov 13, 2018

This is similar to #23558 and shares the same underlying reason: #23578
Found through extensive testing introduced in #23582 (which itself is a split off from #23167)

>>> values = ['a', np.nan, 'c']
>>> pd.Series(values).str.split(' ')
0    [a]
1    NaN
2    [c]
dtype: object
>>> pd.Series(values).str.split(' ', expand=True)
     0
0    a
1  NaN
2    c
>>> pd.Index(values).str.split(' ')
Index([['a'], nan, ['c']], dtype='object')
>>> pd.Index(values).str.split(' ', expand=True)
Traceback (most recent call last):
[...]
TypeError: object of type 'float' has no len()

@jreback jreback added this to the 0.24.0 milestone Nov 16, 2018

meiermark added a commit to meiermark/pandas that referenced this issue Nov 16, 2018

DOC Added resolved issue annotation to tests
DOC Added whatsnew message for resolved issue pandas-dev#23677
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.