Closed pcorpet closed 1 day ago
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
import pandas as pd df = pd.DataFrame({'timestamp': [pd.Timestamp('2024-01-01T00:00', tz='UTC')], 'category': ['A'], 'value': [100]}) df[df.category == "C"].pivot_table(index="category", columns="value", values="timestamp")
This raises an error TypeError: Cannot interpret 'datetime64[ns, UTC]' as a data type
TypeError: Cannot interpret 'datetime64[ns, UTC]' as a data type
It should return an empty DataFrame.
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[X] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
This raises an error
TypeError: Cannot interpret 'datetime64[ns, UTC]' as a data type
Expected Behavior
It should return an empty DataFrame.
Installed Versions