Why head() returns IndexError: Too many levels: Index has only 1 level, not 2 in dask dataframe?
I've found a problem - you can group dask dataframes only by one column.
installs = client.persist(total_revenue.groupby(['InstallTime'])['UserId'].nunique().reset_index())
This worked.
I'm pretty new to dask and have an issue I can't resolve myself.
I've got a dask dataframe:
Dask DataFrame Structure:
npartitions=1622




Date
UserId
AdNetwork
Revenue
Platform
InstallTime




datetime64[ns]
object
object
float64
object
datetime64[ns]




Dask Name: assign, 28302 tasks
I grouped this data by InstallTime and count unique users fro each day to count number of installs by date like this:
installs = client.persist(total_revenue.groupby(['InstallTime', 'Platform'])['UserId'].nunique().reset_index())
And got a new dask dataframe like this:
Dask DataFrame Structure:
npartitions=1




index
InstallTime
Platform
UserId




int64
datetime64[ns]
object
int64




Dask Name: reset_index, 1 tasks
When I want to check what is in dataframe with head() or try any other functions I receive the next error:
IndexError: Too many levels: Index has only 1 level, not 2
When I'm trying to use compute() I receive the same error.
I haven't find such a problem here or in google, so I'll appreciate any help.
Thanks!