Skip to content

Commit

Permalink
Update depecrated fillna statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mfleschutz committed May 22, 2024
1 parent 0c1a67b commit fd872f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions elmada/from_entsoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def load_el_national_generation(

if fillna:
df = fill_special_missing_data_points_for_gen(df=df, country=country, year=year)
df = df.fillna().ffill().fillna().bfill()
df = df.ffill().bfill()

if resample:
df = hp.resample(df, year=year, start_freq=data_freq, target_freq=freq)
Expand Down Expand Up @@ -373,7 +373,7 @@ def prep_dayahead_prices(

if ensure_std_index:
idx = hp.make_datetimeindex(year, hp.estimate_freq(ser), tz=ser.index.tz)
ser = ser.reindex(idx).fillna(method="ffill").fillna(method="bfill")
ser = ser.reindex(idx).ffill().bfill()
ser = ser.reset_index(drop=True)

if fillna:
Expand Down
2 changes: 1 addition & 1 deletion elmada/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ def fill_outlier_and_nan(
if method == "linear":
df = df.interpolate(method="linear")
elif method == "fill":
df = df.fillna(method="bfill").fillna(method="ffill")
df = df.bfill().ffill()

return df

Expand Down

0 comments on commit fd872f1

Please sign in to comment.