Skip to content

Commit 64dde29

Browse files
committed
Fixing eurostat tests
1 parent 573bce0 commit 64dde29

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

pandas_datareader/tests/test_eurostat.py

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,21 @@
88

99
class TestEurostat(object):
1010

11-
def test_get_cdh_e_fos(self):
12-
# Employed doctorate holders in non managerial and non professional
13-
# occupations by fields of science (%)
14-
df = web.DataReader('cdh_e_fos', 'eurostat',
15-
start=pd.Timestamp('2005-01-01'),
11+
def test_get_ert_h_eur_a(self):
12+
# Former euro area national currencies vs. euro/ECU - annual data (ert_h_eur_a)
13+
df = web.DataReader('ert_h_eur_a', 'eurostat',
14+
start=pd.Timestamp('2009-01-01'),
1615
end=pd.Timestamp('2010-01-01'))
17-
1816
assert isinstance(df, pd.DataFrame)
19-
assert df.shape == (2, 336)
20-
21-
df = df['Percentage']['Total']['Natural sciences']
22-
df = df[['Norway', 'Poland', 'Portugal', 'Russia']]
2317

24-
exp_col = pd.MultiIndex.from_product([['Norway', 'Poland', 'Portugal',
25-
'Russia'], ['Annual']],
26-
names=['GEO', 'FREQ'])
27-
exp_idx = pd.DatetimeIndex(['2006-01-01', '2009-01-01'],
28-
name='TIME_PERIOD')
18+
df = df["National currency (former currencies of the euro area countries)"]
19+
df = df["Average"][["Italian lira", "Lithuanian litas"]]
2920

30-
values = np.array([[25.49, np.nan, 39.05, np.nan],
31-
[20.38, 25.1, 27.77, 38.1]])
21+
exp_col = pd.MultiIndex.from_product([['Italian lira', 'Lithuanian litas'], ['Annual']],
22+
names=['CURRENCY', 'FREQ'])
23+
exp_idx = pd.DatetimeIndex(['2009-01-01', '2010-01-01'], name='TIME_PERIOD')
24+
values = np.array([[1936.27, 3.4528],
25+
[1936.27, 3.4528]])
3226
expected = pd.DataFrame(values, index=exp_idx, columns=exp_col)
3327
tm.assert_frame_equal(df, expected)
3428

0 commit comments

Comments
 (0)