I have a dataframe with ~300K rows and ~40 columns. I want to find out if any rows contain null values - and put these \'null\'-rows into a separate dataframe so that I coul
Four fewer characters, but 2 more ms
%%timeit df.isna().T.any() # 52.4 ms ± 352 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) %%timeit df.isna().any(axis=1) # 50 ms ± 423 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
I'd probably use axis=1
axis=1