|
8 | 8 |
|
9 | 9 | class TestEurostat(object):
|
10 | 10 |
|
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'), |
16 | 15 | end=pd.Timestamp('2010-01-01'))
|
17 |
| - |
18 | 16 | 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']] |
23 | 17 |
|
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"]] |
29 | 20 |
|
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]]) |
32 | 26 | expected = pd.DataFrame(values, index=exp_idx, columns=exp_col)
|
33 | 27 | tm.assert_frame_equal(df, expected)
|
34 | 28 |
|
|
0 commit comments