Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Problem in comparisons for DataFrame with pd.NaT #22242
Code Sample, a copy-pastable example if possible
import pandas as pd import datetime as dt tmp = pd.DataFrame.from_records(data=[[dt.datetime(1999,12,31), pd.NaT], [pd.NaT, dt.datetime(1999,12,31)]]) print(tmp.iloc==dt.datetime(1999,12,31)) print(tmp==dt.datetime(1999,12,31))
(Second print statement DataFrame)
When comparing a DataFrame containing pd.NaT (among other datetimes) with a single datetime results appears as True (second print statement).
Second print statement should be