You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the dataframe contains a datetime or timedelta column, whether there are other coulmns present or not, it will raise:
ValueError: shape mismatch: value array of shape (2,) could not be broadcast to indexing result of shape (0,)
This does not happen when there is only one row, or when there are no datetime or timedelta columns. Object dtype is also fine, even if the values are timestamps.
On the nightly build we hit an infinite recursion instead of a ValueError.
topper-123
added
Indexing
Related to indexing on series/frames, not to indexes themselves
and removed
Needs Triage
Issue that has not been reviewed by a pandas team member
labels
May 6, 2023
This works in the main branch, so I'm closing. I don't know when or how this was fixed, which is annoying, but if you see anything here not working as expected, feel free to reopen.
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 the dataframe contains a datetime or timedelta column, whether there are other coulmns present or not, it will raise:
This does not happen when there is only one row, or when there are no datetime or timedelta columns. Object dtype is also fine, even if the values are timestamps.
On the nightly build we hit an infinite recursion instead of a ValueError.
Possibly related #45981.
Expected Behavior
This should not raise and it should be a no-op:
Installed Versions
pandas : 1.5.3
numpy : 1.24.1
pytz : 2022.7.1
dateutil : 2.8.2
setuptools : 65.5.0
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
xlwt : None
zstandard : None
tzdata : None
The text was updated successfully, but these errors were encountered: