I\'d like to drop all values from a table if the rows = nan or 0.
nan
0
I know there\'s a way to do this using pandas i.e pandas.dropna(how
pandas.dropna(how
This will remove all rows which are all zeros, or all nans:
mask = np.all(np.isnan(arr), axis=1) | np.all(arr == 0, axis=1) arr = arr[~mask]
And this will remove all rows which are all either zeros or nans:
mask = np.all(np.isnan(arr) | arr == 0, axis=1) arr = arr[~mask]