From 21289f082f83e02005542a10c2b424647e055e67 Mon Sep 17 00:00:00 2001 From: Tobey Carman Date: Wed, 13 Jan 2021 09:02:18 -0900 Subject: [PATCH] Newer pandas requires date_range function call to create DatetimeIndex --- scripts/input_util.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/input_util.py b/scripts/input_util.py index c87e06a0a..1aa40c6a0 100755 --- a/scripts/input_util.py +++ b/scripts/input_util.py @@ -326,21 +326,21 @@ def climate_ts_plot(args): htcV = hds.variables['time'] ptcV = pds.variables['time'] - hidx = pd.DatetimeIndex( + hidx = pd.DatetimeIndex(pd.date_range( start=nc.num2date(htcV[0], htcV.units, htcV.calendar).strftime(), end=nc.num2date(htcV[-1], htcV.units, htcV.calendar).strftime(), - freq='MS' # <-- month starts + freq='MS') # <-- month starts) ) - pidx = pd.DatetimeIndex( + pidx = pd.DatetimeIndex(pd.date_range( start=nc.num2date(ptcV[0], ptcV.units, ptcV.calendar).strftime(), end=nc.num2date(ptcV[-1], ptcV.units, ptcV.calendar).strftime(), - freq='MS' # <-- month starts + freq='MS') # <-- month starts ) - full_index = pd.DatetimeIndex( + full_index = pd.DatetimeIndex(pd.date_range( start=nc.num2date(htcV[0], htcV.units, htcV.calendar).strftime(), end=nc.num2date(ptcV[-1], ptcV.units, ptcV.calendar).strftime(), - freq='MS' # <-- month starts + freq='MS') # <-- month starts ) df = pd.DataFrame({}, index=full_index)