pandas df, indicate 1 if every column of the row has nan code example Example: pandas if nan, then the row above df.fillna(method='ffill')