Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: KeyError from resample().median() with duplicate column names #14233
Comments
|
Reproducible example:
So it is caused by the duplicate column names. |
jorisvandenbossche
added Bug Resample
labels
Sep 16, 2016
jorisvandenbossche
added this to the
Next Major Release
milestone
Sep 16, 2016
jorisvandenbossche
changed the title from
KeyError from `resample().median()` to BUG: KeyError from resample().median() with duplicate column names
Sep 16, 2016
Dr-Irv
referenced
this issue
Jan 23, 2017
Closed
BUG: GH14233 resample().median() failed if duplicate column names wer… #15202
jreback
modified the milestone: 0.20.0, Next Major Release
Jan 23, 2017
jreback
closed this
in 84bc3b2
Jan 24, 2017
AnkurDedania
added a commit
to AnkurDedania/pandas
that referenced
this issue
Mar 21, 2017
|
|
Dr-Irv + AnkurDedania |
4fd2a22
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
patricktokeeffe commentedSep 16, 2016
I start with a dataframe (
df) containing staggered measurements (select->copy->from_clipboard()):When I try to aggregate measurements into 5-second intervals using
df.resample('5s').median(), I get this traceback:The other documented dispatching methods (
sum,mean,std,sem,max,min,first,last) work just fine (except forohlc, which produces anInvalidIndexError).I can work around the problem like so:
df.resample('5s').apply(lambda x: x.median()). But it seems like dispatching should work here...output of
pd.show_versions()