-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Slicing DatetimeIndex should be timezone aware #24076
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
@jorisvandenbossche a while back there was a couple of threads about slicing conventions with strings and tz-awareness. I think this is orthogonal, but this merits another pair of eyes. |
@jbrockmendel do you remember where this discussion was? From a search, I found possibly related discussion in #18435. I would certainly consider this a bug (but I also have the feeling we have had issues about this before) |
See #16785 and related: The timezone information is just dropped during the parsing process, see the related pull request. |
This looks fixed in master; could use a test.
|
The changes have not affected #16785 - I just hoped we could have been lucky ;-) |
Oops, I think I was looking at the incorrect example; this still looks broken:
|
Code Sample, a copy-pastable example if possible
Problem description
When slicing a DatetimeIndex using a timestamp that has a timezone, the timezone is not used as part o the comparison.
Expected Output
Output of
pd.show_versions()
pandas: 0.23.4
pytest: None
pip: 18.1
setuptools: 40.6.2
Cython: None
numpy: 1.15.4
scipy: 1.1.0
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.5
pytz: 2018.7
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.0.1
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: