@@ -20,18 +20,19 @@ def test_get_ert_h_eur_a(self):
2020 )
2121 assert isinstance (df , pd .DataFrame )
2222
23- header = df .columns .levels [0 ][0 ]
2423 currencies = ["Italian lira" , "Lithuanian litas" ]
25- df = df [header ]
26- df = df ["Average" ][currencies ]
24+ # cols = [(currency, "Average") for currency in currencies]
25+ df_currency = df [currencies ]
26+ df_currency = df_currency .xs ("Average" , axis = 1 , level = 1 )
27+ df_currency .columns = df_currency .columns .droplevel (1 )
2728
2829 exp_col = pd .MultiIndex .from_product (
2930 [currencies , ["Annual" ]], names = ["CURRENCY" , "FREQ" ]
3031 )
3132 exp_idx = pd .DatetimeIndex (["2009-01-01" , "2010-01-01" ], name = "TIME_PERIOD" )
3233 values = np .array ([[1936.27 , 3.4528 ], [1936.27 , 3.4528 ]])
3334 expected = pd .DataFrame (values , index = exp_idx , columns = exp_col )
34- tm .assert_frame_equal (df , expected )
35+ tm .assert_frame_equal (df_currency , expected )
3536
3637 def test_get_sts_cobp_a (self ):
3738 # Building permits - annual data (2010 = 100)
@@ -44,8 +45,8 @@ def test_get_sts_cobp_a(self):
4445
4546 idx = pd .date_range ("2000-01-01" , "2013-01-01" , freq = "AS" , name = "TIME_PERIOD" )
4647 ne_name = (
47- "Index, 2010=100" ,
4848 "Building permits - m2 of useful floor area" ,
49+ "Index, 2010=100" ,
4950 "Unadjusted data (i.e. neither seasonally adjusted nor "
5051 "calendar adjusted data)" ,
5152 "Non-residential buildings, except office buildings" ,
@@ -71,8 +72,8 @@ def test_get_sts_cobp_a(self):
7172 ne = pd .Series (ne_values , name = ne_name , index = idx )
7273
7374 uk_name = (
74- "Index, 2010=100" ,
7575 "Building permits - m2 of useful floor area" ,
76+ "Index, 2010=100" ,
7677 "Unadjusted data (i.e. neither seasonally adjusted nor "
7778 "calendar adjusted data)" ,
7879 "Non-residential buildings, except office buildings" ,
@@ -113,11 +114,11 @@ def test_get_nrg_pc_202(self):
113114 )
114115
115116 name = (
116- "All taxes and levies included" ,
117- "Gigajoule (gross calorific value - GCV)" ,
118117 "Euro" ,
119- "Band D1 : Consumption < 20 GJ " ,
118+ "Gigajoule (gross calorific value - GCV) " ,
120119 "Natural gas" ,
120+ "All taxes and levies included" ,
121+ "Band D1 : Consumption < 20 GJ" ,
121122 "Denmark" ,
122123 "Semi-annual" ,
123124 )
0 commit comments