From e08e12025a1a06d6c88105ab1cbeb0dca330eddd Mon Sep 17 00:00:00 2001 From: mariavictoriadiaz Date: Thu, 7 Sep 2023 23:49:33 -0500 Subject: [PATCH] change append method --- src/aclimate_resampling/resampling.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/aclimate_resampling/resampling.py b/src/aclimate_resampling/resampling.py index 29947f9..659854a 100644 --- a/src/aclimate_resampling/resampling.py +++ b/src/aclimate_resampling/resampling.py @@ -252,7 +252,7 @@ def forecast_station(self,station, prob, daily_data_root, output_root, year_fore clim_feb['leap'] = [True if (year%400 == 0) or (year%4==0 and year%100!=0) else False for year in clim_feb['year']] # Standardize february months by year according to year of forecat - february = [] + february = pd.DataFrame() for i in np.unique(clim_feb['year']): year_data = clim_feb.loc[clim_feb['year']==i,:] year = year_data.loc[:,'leap'] @@ -270,10 +270,10 @@ def forecast_station(self,station, prob, daily_data_root, output_root, year_fore # If both year of forecast and year in climate data are leap years or not, then keep climate data the same year_data = year_data - february.append(year_data) + february = pd.concat([february, year_data]) # Concat standardized february data with the rest of climate data - data = pd.concat(february).drop(['leap'], axis = 1 ) + data = february.drop(['leap'], axis = 1 ) data = pd.concat([data,clim.loc[clim['month'] != 2]]).sort_values(['year','month'])