Fix copy_timeslice
copy timeslice would add data although country not present in load
This commit is contained in:
parent
315f5ef64f
commit
9d36d2bc9b
@ -129,7 +129,7 @@ def copy_timeslice(load, cntry, start, stop, delta, fn_load=None):
|
||||
load.loc[start:stop, cntry] = load.loc[
|
||||
start - delta : stop - delta, cntry
|
||||
].values
|
||||
elif fn_load is not None:
|
||||
elif fn_load is not None and cntry in load:
|
||||
duration = pd.date_range(freq="h", start=start - delta, end=stop - delta)
|
||||
load_raw = load_timeseries(fn_load, duration, [cntry])
|
||||
load.loc[start:stop, cntry] = load_raw.loc[
|
||||
|
Loading…
Reference in New Issue
Block a user