so I have a column('col_name
') in my dataframe(df
), and it contains several 'NaN's. I'm trying to put all of the values in the column into a list. But then I realized that the NaN value is also included in the list as nan
. Please see the code below:
sizes = list(df['col_name'])
The result is like this:
[235, 235, 250, 255, nan, nan, nan, nan]
How do I get rid of all the nan
s?