address fillna(method='{b|f}fill') deprecation (#1181)
* address fillne(method='{b|f}fill') deprecation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
936b490303
commit
e9e0a0da20
@ -852,7 +852,7 @@ if __name__ == "__main__":
|
||||
fuel_price = pd.read_csv(
|
||||
snakemake.input.fuel_price, index_col=0, header=0, parse_dates=True
|
||||
)
|
||||
fuel_price = fuel_price.reindex(n.snapshots).fillna(method="ffill")
|
||||
fuel_price = fuel_price.reindex(n.snapshots).ffill()
|
||||
else:
|
||||
fuel_price = None
|
||||
|
||||
|
@ -631,7 +631,7 @@ def calculate_co2_emissions(n, label, df):
|
||||
weightings = n.snapshot_weightings.generators.mul(
|
||||
n.investment_period_weightings["years"]
|
||||
.reindex(n.snapshots)
|
||||
.fillna(method="bfill")
|
||||
.bfill()
|
||||
.fillna(1.0),
|
||||
axis=0,
|
||||
)
|
||||
|
@ -137,9 +137,7 @@ def add_emission_prices(n, emission_prices={"co2": 0.0}, exclude_co2=False):
|
||||
def add_dynamic_emission_prices(n):
|
||||
co2_price = pd.read_csv(snakemake.input.co2_price, index_col=0, parse_dates=True)
|
||||
co2_price = co2_price[~co2_price.index.duplicated()]
|
||||
co2_price = (
|
||||
co2_price.reindex(n.snapshots).fillna(method="ffill").fillna(method="bfill")
|
||||
)
|
||||
co2_price = co2_price.reindex(n.snapshots).ffill().bfill()
|
||||
|
||||
emissions = (
|
||||
n.generators.carrier.map(n.carriers.co2_emissions) / n.generators.efficiency
|
||||
|
Loading…
Reference in New Issue
Block a user