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
TypeError: split() got an unexpected keyword argument 'expand' | string split function doesn't work [TypeError] | dask 0.20 #4179
Comments
Perhaps your pandas version is too old? Otherwise I don't know what might
be wrong. I recommend providing a minimal failing example.
…On Tue, Nov 6, 2018 at 4:18 AM Ziyad Moraished ***@***.***> wrote:
Hi,
I'm trying to split a column by space as follows:
df.CUSTOMER.str.split(expand=True)
here is the error I get:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-35-07645d325084> in <module>()
----> 1 df.CUSTOMER.str.split(expand=True).head()
TypeError: split() got an unexpected keyword argument 'expand'
when I perform it on the top 5 records, it works perfectly.
df.head().CUSTOMER.str.split(expand=True)
i'm using python 3.6 and dask 0.20
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4179>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AASszEntIFKOO659itQQB3yvs2ds1ZEEks5usVPsgaJpZM4YQCWL>
.
|
pandas version is 0.23.4 here is a quick failing example:
|
Reproduced. Thank you @ZiyadMoraished . At first it looked like we could just pass through the If you start diving in from here: dask/dask/dataframe/accessor.py Lines 119 to 120 in 113457b
You'll eventually get to here: dask/dask/dataframe/accessor.py Lines 61 to 62 in 113457b
Which should be a dataframe with a few text columns, but seems not to be. If anyone wants to investigate this further that would be welcome. |
What are the differences between |
meta.column is |
This is just for the above quoted code sample
we really can't predict the number of splits ahead of time |
@mrocklin we could make num splits parameter mandatory if expansion is required, that way we can be sure. Let me know what your thinking. |
Hrm, you're right. That is unfortunate.
I don't know of a good general solution here. I wonder if anyone else has a suggestion. As you suggest we could ask the user for the information. We could also compute things directly (this would be safer, but more expensive). I don't have strong thoughts on what is best here. |
@TomAugspurger, do you have thoughts on this issue? |
Fixed in #4744 |
Hi,
I'm trying to split a column by space as follows:
df.CUSTOMER.str.split(expand=True)
here is the error I get:
when I perform it on the top 5 records, it works perfectly.
df.head().CUSTOMER.str.split(expand=True)
i'm using python 3.6 and dask 0.20
The text was updated successfully, but these errors were encountered: