Skip to content

Dask 2.1.0, KeyError: 'Column not found: 0' ?  #5124

@apiszcz

Description

@apiszcz

I have a data frame with varying types and am getting the subject error when trying to groupby
After review of some posts on meta and am still not certain where to add meta, since both from_pandas(df, meta) and other attempts fail.

for idx,grp in ddf.groupby(['f1','f2',ddf.dt64.dt.dayofweek,ddf.dt64.dt.hour,ddf.dt64.dt.minute]):
....

C:\g\test\lib\dask\dataframe\groupby.py in __getitem__(self, key)
   1523 
   1524         # error is raised from pandas
-> 1525         g._meta = g._meta[key]
   1526         return g
   1527 

C:\g\test\lib\pandas\core\base.py in __getitem__(self, key)
    266         else:
    267             if key not in self.obj:
--> 268                 raise KeyError("Column not found: {key}".format(key=key))
    269             return self._gotitem(key, ndim=1)
    270 

KeyError: 'Column not found: 0'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions