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.
pandas master branch: import pandas as pd import numpy >>> pd.Series(['1970-01-01', '1970-01-01', '1970-01-01'], dtype="datetime64[ns]").astype(numpy.datetime64, copy=False) *** TypeError: Cannot cast DatetimeArray to dtype datetime64
Actually this is a duplicate of #47844 While I don't have the power to reopen this ticket Yet I wanted to create visibility
>>> import pandas as pd >>> import numpy >>> pd.Series(['1970-01-01', '1970-01-01', '1970-01-01'], dtype="datetime64[ns]").astype(numpy.datetime64, copy=False) 0 1970-01-01 1 1970-01-01 2 1970-01-01 dtype: datetime64[ns]
pandas-2.0.0
The text was updated successfully, but these errors were encountered:
This behavior was deprecated. Running this on pandas 1.5.3 gives a FutureWarning. The deprecation was enforced in 2.0
FutureWarning
Enforced deprecation disallowing unit-less "datetime64" dtype in :meth:Series.astype and :meth:DataFrame.astype (:issue:47844)
Series.astype
DataFrame.astype
47844
from the 2.0 release notes - #49391
Sorry, something went wrong.
Yeah this behavior was deprecated and enforced in 2.0 so closing
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
Actually this is a duplicate of #47844
While I don't have the power to reopen this ticket
Yet I wanted to create visibility
Expected Behavior
Installed Versions
pandas-2.0.0
The text was updated successfully, but these errors were encountered: