Replacing Pandas or Numpy Nan with a None to use with MysqlDB
@bogatron has it right, you can use where, it’s worth noting that you can do this natively in pandas: Note: this changes the dtype of all columns to object. Example: Note: what you cannot do recast the DataFrames dtype to allow all datatypes types, using astype, and then the DataFrame fillna method: Unfortunately neither this, nor using replace, works with None see this (closed) issue. As an aside, … Read more