diff --git a/notebooks/4-taylor-diagrams.ipynb b/notebooks/4-taylor-diagrams.ipynb index ec53e57..ec678ff 100644 --- a/notebooks/4-taylor-diagrams.ipynb +++ b/notebooks/4-taylor-diagrams.ipynb @@ -56,6 +56,7 @@ "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", + "import pandas as pd\n", "import xarray as xr\n", "\n", "import cftime\n", @@ -144,7 +145,9 @@ "source": [ "# Change hourly data to monthly\n", "era5 = era5.rename({'initial_time0_hours': 'time'}) # Changing dimension name for convenience\n", - "era5_resampled = era5.resample(time='MS', loffset='15D').mean() # loffsest to set resampling to the center of each month as in CMIP5 data\n", + "era5_resampled = era5.resample(time='MS').mean()\n", + "offset = pd.tseries.frequencies.to_offset('15D') # use offsest to adjust to the center of each month as in CMIP5 data\n", + "era5_resampled['time'] = era5_resampled.get_index('time') + offset\n", "\n", "era5_resampled" ] diff --git a/notebooks/7-animation.ipynb b/notebooks/7-animation.ipynb index 24585bd..41e6f5d 100644 --- a/notebooks/7-animation.ipynb +++ b/notebooks/7-animation.ipynb @@ -341,8 +341,8 @@ "metadata": {}, "outputs": [], "source": [ - "vmin = t.min()\n", - "vmax = t.max()\n", + "vmin = t.min().values\n", + "vmax = t.max().values\n", "levels = 30\n", "\n", "# create initial plot that we will update\n",