NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| import pandas as pd | |
| from matplotlib import pyplot as plt | |
| import numpy as np | |
| %matplotlib inline | |
| url = 'https://storage.googleapis.com/pangeo-cmip6/pangeo-cmip6-zarr-consolidated-stores.csv' | |
| df = pd.read_csv(url) | |
| run_count = df[df.activity_id == 'CMIP'].groupby(['experiment_id', 'source_id']).zstore.count() | |
| rcu = run_count.unstack(level=-1) |
| # | |
| # Hi all, | |
| # this is the Python code I used to make the visualization "Temperature circle" | |
| # (https://twitter.com/anttilip/status/892318734244884480). | |
| # Please be aware that originally I wrote this for my tests only so the | |
| # code was not ment to be published and is a mess and has no comments. | |
| # Feel free to improve, modify, do whatever you want with it. If you decide | |
| # to use the code, make an improved version of it, or it is useful for you | |
| # in some another way I would be happy to know about it. You can contact me | |
| # for example in Twitter (@anttilip). Unchecked demo data (no quarantees) |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| """ | |
| Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ] | |
| Modified from remove_output by Minrk | |
| """ | |
| import sys | |
| import io | |
| import os | |
| from IPython.nbformat.current import read, write |