I have a largely empty dataframe of poorly formatted dates that I converted into DateTime format.
from io import StringIO
data = StringIO("""issue_date,issue_date_dt
,
,
19600215.0,1960-02-15
,
,""")
df = pd.read_csv(data, parse_dates=[1])
Which produces
issue_date issue_date_dt
0 NaN NaT
1 NaN NaT
2 19600215.0 1960-02-15
3 NaN NaT
4 NaN NaT
I'd expect that I could use df.any() to find whether there was a value in a row or column. axis=0
behaves as expected:
df.any(axis=0)
issue_date True
issue_date_dt True
dtype: bool
But axis=1
just returns false for all rows all the time.
df.any(axis=1)
0 False
1 False
2 False
3 False
4 False
dtype: bool