Skip to content

Instantly share code, notes, and snippets.

@ronsims2
Last active August 5, 2022 17:04
Show Gist options
  • Save ronsims2/53dd8c5c09b4d3da5b7329cd5665ec17 to your computer and use it in GitHub Desktop.
Save ronsims2/53dd8c5c09b4d3da5b7329cd5665ec17 to your computer and use it in GitHub Desktop.
Jupyter Notebook Tips
# Add spaces between plots
from IPython.core.display import Javascript
# place this after the code that displays the plots
# This code adds a small amount of margin to the bottom of each div that contains a plot image
Javascript('Array.from(document.querySelectorAll(".display_data")).forEach(item => item.style.marginBottom = "1rem")')
# Get the number of missing values group the the number of rows missing the same number of values
# This helps see patterns of missingness
df.isnull().sum(axis=1).value_counts()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment