Eliminar nan de la lista de python
cleanedList = [x for x in countries if str(x) != 'nan']
Worried Walrus
cleanedList = [x for x in countries if str(x) != 'nan']
df.dropna(subset=[columns],inplace=True)
x = x[~numpy.isnan(x)]
df = df[df['my_var'].notna()]
df.dropna(subset = ["column2"], inplace=True)
a = [[y for y in x if pd.notna(y)] for x in df.values.tolist()]
print (a)
[['str', 'aad', 'asd'], ['ddd'], ['xyz', 'abc'], ['btc', 'trz', 'abd']]