Skip to content

Instantly share code, notes, and snippets.

@konverner
Last active June 15, 2023 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konverner/316c62c8354e93cc486daed01ab27662 to your computer and use it in GitHub Desktop.
Save konverner/316c62c8354e93cc486daed01ab27662 to your computer and use it in GitHub Desktop.
show percent of nan values
import pandas as pd
df = ...
pd.options.display.float_format = '{:,.1f}%'.format
print((df.isna().sum()/df.shape[0]).sort_values(ascending=False)*100)
pd.options.display.float_format = '{:,.2f}'.format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment