Avoid NaN values in dataframe in Python

0

How could I avoid NaN values when generating a graph with matplotlib in Python? I mean, I do not want to replace them, just do not take them into account. It is to generate bar and pie charts only with the valid values of a column. I would also like to do the same with a matrix of points (x, y)

    
asked by Agu 1997 08.06.2018 в 16:58
source

1 answer

0

You can eliminate them, pandas has the dropna method that eliminates all the rows where you find NaN values

df.dropna( inplace=True )

You can read more about this method here

    
answered by 09.06.2018 в 23:36