Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
AmbiguousTimeError on groupby when including a DST change #14682
A small, complete example of the issue
#!/usr/bin/env python import pandas as pd df=pd.DataFrame([1477786980,1477790580],columns=['ts']) df['date']=pd.to_datetime(df.ts, unit='s').dt.tz_localize('UTC').dt.tz_convert('Europe/Madrid') df.set_index('date', inplace=True) dfo = df.groupby(pd.TimeGrouper('5min'))
I've been trying to debug the above issue.
Tried adding the ambiguous keyword to the constructor of the Timestamps... but I wasn't sure how to set it (as
The code raising the exception seems to have been modified with commit dcc68d7 where the
I've modified the code to not do that... but then I had to modify an assert at pandas.tseries.index.py that it is checking for equality of time zones... but it turns that Europe/Madrid on DST is considered different from Europe/Madrid not on DST.
I'll try to create a pull request with my changes so that you can comment.