Skip to content

Commit

Permalink
change append method
Browse files Browse the repository at this point in the history
  • Loading branch information
mariavictoriadiaz committed Sep 8, 2023
1 parent 0e56300 commit e08e120
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/aclimate_resampling/resampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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'])


Expand Down

0 comments on commit e08e120

Please sign in to comment.