Skip to content

Instantly share code, notes, and snippets.

@taniomi
Created March 10, 2025 14:55
Show Gist options
  • Select an option

  • Save taniomi/ee635617b033fe7ee825bdec39dbe562 to your computer and use it in GitHub Desktop.

Select an option

Save taniomi/ee635617b033fe7ee825bdec39dbe562 to your computer and use it in GitHub Desktop.
Easily replace values in the entire pandas dataframe
df.replace(to_replace='nan', value=None, inplace=True)
df.replace(to_replace='[]', value=None, inplace=True)
df.replace(to_replace='', value=None, inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment