BUG: Timestamp.tz and DatetimeIndex.tz are inconsistent when pytz 2024.2 is installed #59833
Open
2 of 3 tasks
Labels
Closing Candidate
May be closeable, needs more eyeballs
Compat
pandas objects compatability with Numpy or Python functions
Dependencies
Required and optional dependencies
Timezones
Timezone data dtype
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
If
pytz = "==2024.2"
is installed the example printsDowngrading
pytz
to2024.1
resolves this issue.Expected Behavior
The
.tz
property should produce the same result regardless if the object is aTimestamp
orDatetimeIndex
. Hence, I expect this example to printInstalled Versions
pandas : 2.2.2
numpy : 2.1.1
pytz : 2024.2
dateutil : 2.9.0.post0
setuptools : 69.2.0
pip : 24.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : None
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
The text was updated successfully, but these errors were encountered: