cleanedList = [x for x in countries if str(x) != 'nan']
a = a[~(np.isnan(a).any(axis=1))] # removes rows containing at least one nan
a = a[~(np.isnan(a).all(axis=1))] # removes rows containing all nan
df = df[df.index.notnull()]
function removeNaN(arr) {
return arr.filter(item => !isNaN(item));
}
df = df[df['my_var'].notna()]
df.dropna(subset = ["column2"], inplace=True)
a[ ~np.isnan(a).any(axis=1),:]
cleanedList = [x for x in countries if str(x) != 'nan']
cleanedList = [x for x in countries if str(x) != 'nan']