Skip to content

Commit dcd6d92

Browse files
authored
Merge 4a0a808 into cc86550
2 parents cc86550 + 4a0a808 commit dcd6d92

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

notebooks/4-taylor-diagrams.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"source": [
5757
"import matplotlib.pyplot as plt\n",
5858
"import numpy as np\n",
59+
"import pandas as pd\n",
5960
"import xarray as xr\n",
6061
"\n",
6162
"import cftime\n",
@@ -144,7 +145,9 @@
144145
"source": [
145146
"# Change hourly data to monthly\n",
146147
"era5 = era5.rename({'initial_time0_hours': 'time'}) # Changing dimension name for convenience\n",
147-
"era5_resampled = era5.resample(time='MS', loffset='15D').mean() # loffsest to set resampling to the center of each month as in CMIP5 data\n",
148+
"era5_resampled = era5.resample(time='MS').mean()\n",
149+
"offset = pd.tseries.frequencies.to_offset('15D') # use offsest to adjust to the center of each month as in CMIP5 data\n",
150+
"era5_resampled['time'] = era5_resampled.get_index('time') + offset\n",
148151
"\n",
149152
"era5_resampled"
150153
]

notebooks/7-animation.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@
341341
"metadata": {},
342342
"outputs": [],
343343
"source": [
344-
"vmin = t.min()\n",
345-
"vmax = t.max()\n",
344+
"vmin = t.min().values\n",
345+
"vmax = t.max().values\n",
346346
"levels = 30\n",
347347
"\n",
348348
"# create initial plot that we will update\n",

0 commit comments

Comments
 (0)