We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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.
assert pd.DatetimeIndex(['2020-01-01'], dtype='datetime64[s]').equals( pd.DatetimeIndex(['2020-01-01'], dtype='datetime64[ns]') )
This assertion should pass, but it fails.
The assertion should pass for the same reason that this one does:
assert pd.Index([0, 1], dtype=int).equals(pd.Index([0., 1.], dtype=float))
Or that this one does:
assert np.array_equal( pd.DatetimeIndex(['2020-01-01'], dtype='datetime64[s]').values, pd.DatetimeIndex(['2020-01-01'], dtype='datetime64[ns]').values )
pandas : 2.1.1 numpy : 1.23.5 pytz : 2023.3 dateutil : 2.8.2 setuptools : 67.7.2 pip : 23.1.2 Cython : 3.0.0 pytest : 7.3.1 hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : 4.9.2 html5lib : 1.1 pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : 8.13.2 pandas_datareader : None bs4 : 4.12.2 bottleneck : 1.3.7 dataframe-api-compat: None fastparquet : None fsspec : 2023.6.0 gcsfs : None matplotlib : 3.7.1 numba : 0.56.4 numexpr : 2.8.7 odfpy : None openpyxl : 3.1.2 pandas_gbq : None pyarrow : 10.0.1 pyreadstat : None pyxlsb : None s3fs : 2023.6.0 scipy : 1.10.1 sqlalchemy : None tables : None tabulate : None xarray : 2023.4.2 xlrd : 2.0.1 zstandard : None tzdata : 2023.3 qtpy : 2.3.1 pyqt5 : None
The text was updated successfully, but these errors were encountered:
I think this is related to this issue #55564
Sorry, something went wrong.
Confirmed. Exists on main and 2.1.x.
2.1.x
Not related to #55564, but it is related to #55638 and #33940. 33940 is probably a good place to comment if you have an opinion here.
This behaviour is not limited to pd.DatetimeIndex, but also applies to pd.Series and pd.Dataframe. At least in version 2.0.3.
pd.DatetimeIndex
pd.Series
pd.Dataframe
2.0.3
xarray>=2025.1.2
np.datetime64
datetime
No branches or pull requests
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
This assertion should pass, but it fails.
Expected Behavior
The assertion should pass for the same reason that this one does:
Or that this one does:
Installed Versions
pandas : 2.1.1
numpy : 1.23.5
pytz : 2023.3
dateutil : 2.8.2
setuptools : 67.7.2
pip : 23.1.2
Cython : 3.0.0
pytest : 7.3.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.9.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.13.2
pandas_datareader : None
bs4 : 4.12.2
bottleneck : 1.3.7
dataframe-api-compat: None
fastparquet : None
fsspec : 2023.6.0
gcsfs : None
matplotlib : 3.7.1
numba : 0.56.4
numexpr : 2.8.7
odfpy : None
openpyxl : 3.1.2
pandas_gbq : None
pyarrow : 10.0.1
pyreadstat : None
pyxlsb : None
s3fs : 2023.6.0
scipy : 1.10.1
sqlalchemy : None
tables : None
tabulate : None
xarray : 2023.4.2
xlrd : 2.0.1
zstandard : None
tzdata : 2023.3
qtpy : 2.3.1
pyqt5 : None
The text was updated successfully, but these errors were encountered: