@@ -20,18 +20,19 @@ def test_get_ert_h_eur_a(self):
20
20
)
21
21
assert isinstance (df , pd .DataFrame )
22
22
23
- header = df .columns .levels [0 ][0 ]
24
23
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 )
27
28
28
29
exp_col = pd .MultiIndex .from_product (
29
30
[currencies , ["Annual" ]], names = ["CURRENCY" , "FREQ" ]
30
31
)
31
32
exp_idx = pd .DatetimeIndex (["2009-01-01" , "2010-01-01" ], name = "TIME_PERIOD" )
32
33
values = np .array ([[1936.27 , 3.4528 ], [1936.27 , 3.4528 ]])
33
34
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 )
35
36
36
37
def test_get_sts_cobp_a (self ):
37
38
# Building permits - annual data (2010 = 100)
@@ -44,8 +45,8 @@ def test_get_sts_cobp_a(self):
44
45
45
46
idx = pd .date_range ("2000-01-01" , "2013-01-01" , freq = "AS" , name = "TIME_PERIOD" )
46
47
ne_name = (
47
- "Index, 2010=100" ,
48
48
"Building permits - m2 of useful floor area" ,
49
+ "Index, 2010=100" ,
49
50
"Unadjusted data (i.e. neither seasonally adjusted nor "
50
51
"calendar adjusted data)" ,
51
52
"Non-residential buildings, except office buildings" ,
@@ -71,8 +72,8 @@ def test_get_sts_cobp_a(self):
71
72
ne = pd .Series (ne_values , name = ne_name , index = idx )
72
73
73
74
uk_name = (
74
- "Index, 2010=100" ,
75
75
"Building permits - m2 of useful floor area" ,
76
+ "Index, 2010=100" ,
76
77
"Unadjusted data (i.e. neither seasonally adjusted nor "
77
78
"calendar adjusted data)" ,
78
79
"Non-residential buildings, except office buildings" ,
@@ -113,11 +114,11 @@ def test_get_nrg_pc_202(self):
113
114
)
114
115
115
116
name = (
116
- "All taxes and levies included" ,
117
- "Gigajoule (gross calorific value - GCV)" ,
118
117
"Euro" ,
119
- "Band D1 : Consumption < 20 GJ " ,
118
+ "Gigajoule (gross calorific value - GCV) " ,
120
119
"Natural gas" ,
120
+ "All taxes and levies included" ,
121
+ "Band D1 : Consumption < 20 GJ" ,
121
122
"Denmark" ,
122
123
"Semi-annual" ,
123
124
)
0 commit comments