BUG: AttributeError raised with pd.concat between a None and Timestamp · Issue #52093 · pandas-dev/pandas (original) (raw)
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
import pandas as pd data = [{'A':None}] df = pd.DataFrame(data) data_2 = [{'A': pd.to_datetime("1990-12-20 00:00:00+00:00")}] df_2 = pd.DataFrame(data_2) pd.concat([df, df_2])
Issue Description
When running pd.concat
between two DataFrame: one with None
as an object, and a second, with a timezone-enabled pandas._libs.tslibs.timestamps.Timestamp
an AttributeError
is raised.
AttributeError: 'NoneType' object has no attribute 'value'
Expected Behavior
I expect this to return the same response when a non-timezone-enabled pandas._libs.tslibs.timestamps.Timestamp
, which is the None
changes to a pd.NaT
Installed Versions
INSTALLED VERSIONS
commit : c2a7f1a
python : 3.11.2.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.102.1-microsoft-standard-WSL2
Version : #1 SMP Wed Mar 2 00:30:59 UTC 2022
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.0.0rc1
numpy : 1.24.2
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 65.5.1
pip : 22.3.1
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
bs4 : None
bottleneck : None
brotli : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : None
qtpy : None
pyqt5 : None