remove all records which has atleast one column nan pd code example
Example 1: remove all rows where one ccolumns egale to nan
#remove in dataframe but no in the file
df = df[df['column'].notna()]
#remove in dataframe and in the file
df.dropna(subset=['EPS'], how='all', inplace=True)
Example 2: when converting from dataframe to list delete nan values
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']]