1

I'm using Pandas to parse a csv and I'm reading nan values from an excel and I'd like to convert them to None.

season_matches = pd.read_csv(io.StringIO(rv.decode('utf-8')))
season_matches = season_matches.replace(np.nan, None)
season_matches = season_matches.to_dict()

This however returns TypeError: cannot replace [nan] with method pad on a DataFrame.

FranGoitia
  • 1,965
  • 3
  • 30
  • 49

0 Answers0