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
col1
A 2000-01-02 1
2000-01-09 1
B 2000-01-02 1
2000-01-09 1
dtype: int64
col2
a 2000-01-02 1
2000-01-09 1
b 2000-01-02 1
c 2000-01-09 1
dtype: int64
2000-01-02 2000-01-09
col1
A 1 1
B 1 1
col2
a 2000-01-02 1
2000-01-09 1
b 2000-01-02 1
c 2000-01-09 1
dtype: int64
This seems like an inconsistency to me, in the sense that, if 1 and 3 do not return the same result, neither should 2 and 4. Is this a bug, or is df.groupby(col).resample('x') supposed to behave like this, and is it supposed to behave differently to df.groubpy[(col, pd.TimeGrouper(x)])?
Note that in df col1 has two groups of identical size, while col2 has unequal sized groups. I'm not sure if that's the problem, but this inconsistency goes away for some choices of N (e.g. all four lines above return multiindex for N=3 and N=24?!)
returns
If I then do the following groupbys, lines 2 and 4 return the same result (a multiindex), but line 3 returns the result of running
.unstack
on line 1.This seems like an inconsistency to me, in the sense that, if 1 and 3 do not return the same result, neither should 2 and 4. Is this a bug, or is
df.groupby(col).resample('x')
supposed to behave like this, and is it supposed to behave differently todf.groubpy[(col, pd.TimeGrouper(x)])
?Note that in
df
col1 has two groups of identical size, while col2 has unequal sized groups. I'm not sure if that's the problem, but this inconsistency goes away for some choices ofN
(e.g. all four lines above return multiindex forN=3
andN=24
?!)The text was updated successfully, but these errors were encountered: