address pandas 1.4 deprectations
This commit is contained in:
parent
c8c1c3c46e
commit
09f1135b51
@ -245,7 +245,9 @@ def _add_links_from_tyndp(buses, links, links_tyndp, europe_shape):
|
||||
|
||||
links_tyndp.index = "T" + links_tyndp.index.astype(str)
|
||||
|
||||
return buses, links.append(links_tyndp, sort=True)
|
||||
links = pd.concat([links, links_tyndp], sort=True)
|
||||
|
||||
return buses, links
|
||||
|
||||
|
||||
def _load_lines_from_eg(buses, eg_lines):
|
||||
|
@ -91,7 +91,7 @@ def add_custom_powerplants(ppl, custom_powerplants, custom_ppl_query=False):
|
||||
dtype={'bus': 'str'})
|
||||
if isinstance(custom_ppl_query, str):
|
||||
add_ppls.query(custom_ppl_query, inplace=True)
|
||||
return ppl.append(add_ppls, sort=False, ignore_index=True, verify_integrity=True)
|
||||
return pd.concat([ppl, add_ppls], sort=False, ignore_index=True, verify_integrity=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
@ -169,8 +169,10 @@ def nuts3(country_shapes, nuts3, nuts3pop, nuts3gdp, ch_cantons, ch_popgdp):
|
||||
swiss = pd.read_excel(ch_popgdp, skiprows=3, index_col=0)
|
||||
swiss.columns = swiss.columns.to_series().map(cantons)
|
||||
|
||||
pop = pop.append(pd.to_numeric(swiss.loc['Residents in 1000', 'CH040':]))
|
||||
gdp = gdp.append(pd.to_numeric(swiss.loc['Gross domestic product per capita in Swiss francs', 'CH040':]))
|
||||
swiss_pop = pd.to_numeric(swiss.loc['Residents in 1000', 'CH040':])
|
||||
pop = pd.concat([pop, swiss_pop])
|
||||
swiss_gdp = pd.to_numeric(swiss.loc['Gross domestic product per capita in Swiss francs', 'CH040':])
|
||||
gdp = pd.concat([gdp, swiss_gdp])
|
||||
|
||||
df = df.join(pd.DataFrame(dict(pop=pop, gdp=gdp)))
|
||||
|
||||
@ -194,7 +196,7 @@ def nuts3(country_shapes, nuts3, nuts3pop, nuts3gdp, ch_cantons, ch_popgdp):
|
||||
manual['geometry'] = manual['country'].map(country_shapes)
|
||||
manual = manual.dropna()
|
||||
|
||||
df = df.append(manual, sort=False)
|
||||
df = pd.concat([df, manual], sort=False)
|
||||
|
||||
df.loc['ME000', 'pop'] = 650.
|
||||
|
||||
|
@ -124,7 +124,8 @@ def simplify_network_to_380(n):
|
||||
several_trafo_b = trafo_map.isin(trafo_map.index)
|
||||
trafo_map.loc[several_trafo_b] = trafo_map.loc[several_trafo_b].map(trafo_map)
|
||||
missing_buses_i = n.buses.index.difference(trafo_map.index)
|
||||
trafo_map = trafo_map.append(pd.Series(missing_buses_i, missing_buses_i))
|
||||
missing = pd.Series(missing_buses_i, missing_buses_i)
|
||||
trafo_map = pd.concat([trafo_map, missing])
|
||||
|
||||
for c in n.one_port_components|n.branch_components:
|
||||
df = n.df(c)
|
||||
|
Loading…
Reference in New Issue
Block a user