Answers for "if condition is true keep the values else nan in pandas dataframe"

4

to detect if a data frame has nan values

df.isnull().sum().sum()
5
Posted by: Guest on April-23-2020
0

pandas if nan, then the row above

df.fillna(method='ffill')
Posted by: Guest on July-22-2020

Code answers related to "if condition is true keep the values else nan in pandas dataframe"

Browse Popular Code Answers by Language