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
Do single-row dataframes (not series) get special treatment in some way? It seems you can do arbitrary groupby operations on them on non-existent columns without errors.
df1 = pd.DataFrame(np.random.randn(1,4), columns=list('ABCD'))
df2 = pd.DataFrame(np.random.randn(2,4), columns=list('ABCD'))
In [3]: df1.groupby('asdf')
Out[3]: pandas.core.groupby.DataFrameGroupBy object at 0x1139acb10
In [4]: df2.groupby('asdf')
KeyError: 'asdf'
The text was updated successfully, but these errors were encountered:
Do single-row dataframes (not series) get special treatment in some way? It seems you can do arbitrary groupby operations on them on non-existent columns without errors.
The text was updated successfully, but these errors were encountered: