I have a pandas dataframe with nan values.I want to delete initial rows with all nan values but do not want to delete all rows afterthat thoough they may have nan values in entire row.
i use dropna(how="all") but it will delete all rows which have nan values in entire rows. But I want to delete only initial rows with all nan values
You can craft a boolean mask with
notna
,any
, andcummax
for boolean indexing: