-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Description
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
from typing import cast
import pandas as pd
df = pd.DataFrame(
{"x": [1, 2, 3], "y": pd.date_range("3/1/2023", "3/3/2023")},
index=pd.Index(["a", "b", "c"]),
).convert_dtypes()
df["x"] = cast("pd.Series[pd.Timestamp]", df["y"]) + pd.Timedelta(days=3)
df.loc[:, "x"] = [pd.NaT, pd.NaT, pd.NaT]Issue Description
This raises an error on the latest build of pandas (3.0.0).
TypeError: value should be a 'Timestamp', 'NaT', or array of those. Got object array instead.
while the list should fall under the array of those. As a proof when we try to df.loc[:, "x"] = pd.NaT, it works fine.
Expected Behavior
This setitem should work without issue, as well the combination of pd.NA, pd.NaT and None should work too, ie: [None, pd.NA, pd.NaT] should work fine too.
Installed Versions
Details
INSTALLED VERSIONS
commit : a682616
python : 3.14.0
python-bits : 64
OS : Darwin
OS-release : 25.0.0
Version : Darwin Kernel Version 25.0.0: Wed Sep 17 21:41:39 PDT 2025; root:xnu-12377.1.9~141/RELEASE_ARM64_T8103
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 3.0.0rc0+56.ga682616387
numpy : 2.3.5
dateutil : 2.9.0.post0
pip : 25.3
Cython : None
sphinx : None
IPython : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.14.3
bottleneck : None
fastparquet : None
fsspec : 2025.12.0
html5lib : 1.1
hypothesis : None
gcsfs : None
jinja2 : 3.1.6
lxml.etree : 6.0.2
matplotlib : 3.10.8
numba : None
numexpr : 2.14.1
odfpy : None
openpyxl : 3.1.5
psycopg2 : None
pymysql : None
pyarrow : 22.0.0
pyiceberg : None
pyreadstat : 1.3.2
pytest : 9.0.2
python-calamine : None
pytz : 2025.2
pyxlsb : 1.0.10
s3fs : None
scipy : 1.16.3
sqlalchemy : 2.0.45
tables : None
tabulate : 0.9.0
xarray : 2025.12.0
xlrd : 2.0.2
xlsxwriter : 3.2.9
zstandard : None
qtpy : None
pyqt5 : None