@@ -453,6 +453,7 @@ def get_data_DEA(tech, data_in, expectation=None):
453
453
df_final ["unit" ] = (df_final .rename (index = lambda x :
454
454
x [x .rfind ("[" )+ 1 : x .rfind ("]" )]).index .values )
455
455
else :
456
+ df_final .index = df_final .index .str .replace ("\[" , "(" , regex = True ).str .replace ("\]" , ")" , regex = True )
456
457
df_final ["unit" ] = (df_final .rename (index = lambda x :
457
458
x [x .rfind ("(" )+ 1 : x .rfind (")" )]).index .values )
458
459
df_final .index = df_final .index .str .replace (r" \(.*\)" ,"" , regex = True )
@@ -687,10 +688,14 @@ def clean_up_units(tech_data, value_column="", source=""):
687
688
688
689
tech_data .loc [tech_data .unit .str .contains ("mio EUR" ), value_column ] *= 1e6
689
690
tech_data .unit = tech_data .unit .str .replace ("mio EUR" , "EUR" )
691
+
692
+ tech_data .loc [tech_data .unit .str .contains ("mill. EUR" ), value_column ] *= 1e6
693
+ tech_data .unit = tech_data .unit .str .replace ("mill. EUR" , "EUR" )
690
694
691
695
tech_data .loc [tech_data .unit .str .contains ("1000EUR" ), value_column ] *= 1e3
692
696
tech_data .unit = tech_data .unit .str .replace ("1000EUR" , "EUR" )
693
697
698
+ tech_data .unit = tech_data .unit .str .replace ("k EUR" , "kEUR" )
694
699
tech_data .loc [tech_data .unit .str .contains ("kEUR" ), value_column ] *= 1e3
695
700
tech_data .unit = tech_data .unit .str .replace ("kEUR" , "EUR" )
696
701
@@ -989,6 +994,7 @@ def order_data(tech_data):
989
994
(df .unit == "EUR/MWh/km" ) |
990
995
(df .unit == "EUR/MWh" ) |
991
996
(df .unit == "EUR/MWhoutput" ) |
997
+ (df .unit == "EUR/MWh_CH4" ) |
992
998
(tech == "biogas upgrading" ))].copy ()
993
999
if len (vom )== 1 :
994
1000
vom .loc [:,"parameter" ] = "VOM"
@@ -1898,10 +1904,11 @@ def add_energy_storage_database(costs, data_year):
1898
1904
agg = df .loc [power_filter ].groupby (["technology" , "year" ]).sum (numeric_only = True )
1899
1905
charger_investment_filter = charger_filter & (df .technology == tech ) & (df .parameter == "investment" )
1900
1906
discharger_investment_filter = discharger_filter & (df .technology == tech ) & (df .parameter == "investment" )
1901
- df .loc [charger_investment_filter & df .year == 2021 , "value" ] += agg .loc [(tech , 2021 )]/ 2
1902
- df .loc [charger_investment_filter & df .year == 2030 , "value" ] += agg .loc [(tech , 2030 )]/ 2
1903
- df .loc [discharger_investment_filter & df .year == 2021 , "value" ] += agg .loc [(tech , 2021 )]/ 2
1904
- df .loc [discharger_investment_filter & df .year == 2030 , "value" ] += agg .loc [(tech , 2030 )]/ 2
1907
+ for a in [2021 , 2030 ]:
1908
+ df_year = (df .year == a )
1909
+ df .loc [charger_investment_filter & df_year , "value" ] += agg .loc [(tech , a )]/ 2
1910
+ df .loc [discharger_investment_filter & df_year , "value" ] += agg .loc [(tech , a )]/ 2
1911
+
1905
1912
df .loc [:,"technology" ] = df ["technology" ] + "-" + df ["technology_type" ]
1906
1913
1907
1914
# aggregate technology_type and unit
0 commit comments