Skip to content

Instantly share code, notes, and snippets.

@markusritschel
Created December 10, 2021 16:45
Show Gist options
  • Save markusritschel/0e3d940485b42f72dcbed786654faae2 to your computer and use it in GitHub Desktop.
Save markusritschel/0e3d940485b42f72dcbed786654faae2 to your computer and use it in GitHub Desktop.
Generates a dictionary with the official CMIP6 model colors
import pandas as pd
url = "https://github.com/IPCC-WG1/colormaps/blob/master/CMIP6_color.xlsx?raw=true"
df = pd.read_excel(url, index_col=[0])
cmip6_colors = {i:k.values for (i,k) in df.iterrows()}
# or as one-liner
# cmip6_colors = {i:k.values for (i,k) in pd.read_excel("https://github.com/IPCC-WG1/colormaps/blob/master/CMIP6_color.xlsx?raw=true", index_col=[0]).iterrows()}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment