-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Troubles with date_range and DST #20596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yup, This looks incorrect since the
|
this is a duplicate issue from quite a while ago if u can do a search |
xref #16980 |
closing as master issue #20633 |
Related to this issue, I have found doing a pandas.date_range over the repeated hour at the end of DST produces duplicate hours. start = pd.Timestamp('2019-11-03 00:00:00', tz='US/Central') end = pd.Timestamp('2019-11-04 00:00:00', tz='US/Central') pd.date_range(start=start, end=end, freq='H') DatetimeIndex(['2019-11-03 00:00:00-05:00', '2019-11-03 01:00:00-06:00', Is there a work around to get reliable timestamp for every hour in a day? |
After making a manual work around, I found that pd.Dataframe.index resets the time offset back to the incorrect value. df df.index |
Code Sample
Problem description
It seems that the
D
frequency is somewhat broken around DST dates. The code above gives the same result aspd.date_range(..., freq='168H', tz='Europe/Paris')
, but it should be different.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.5.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-5-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8
LOCALE: fr_FR.UTF-8
pandas: 0.22.0
pytest: None
pip: 9.0.3
setuptools: 39.0.1
Cython: None
numpy: 1.14.2
scipy: 1.0.1
pyarrow: None
xarray: None
IPython: 6.3.0
sphinx: None
patsy: None
dateutil: 2.7.2
pytz: 2018.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.2.2
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: