Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas_datareader/tests/test_econdb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import pandas as pd
import pytest
from pandas import testing as tm
import pytest

from pandas_datareader import data as web

Expand Down
19 changes: 10 additions & 9 deletions pandas_datareader/tests/test_eurostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ def test_get_ert_h_eur_a(self):
)
assert isinstance(df, pd.DataFrame)

header = df.columns.levels[0][0]
currencies = ["Italian lira", "Lithuanian litas"]
df = df[header]
df = df["Average"][currencies]
# cols = [(currency, "Average") for currency in currencies]
df_currency = df[currencies]
df_currency = df_currency.xs("Average", axis=1, level=1)
df_currency.columns = df_currency.columns.droplevel(1)

exp_col = pd.MultiIndex.from_product(
[currencies, ["Annual"]], names=["CURRENCY", "FREQ"]
)
exp_idx = pd.DatetimeIndex(["2009-01-01", "2010-01-01"], name="TIME_PERIOD")
values = np.array([[1936.27, 3.4528], [1936.27, 3.4528]])
expected = pd.DataFrame(values, index=exp_idx, columns=exp_col)
tm.assert_frame_equal(df, expected)
tm.assert_frame_equal(df_currency, expected)

def test_get_sts_cobp_a(self):
# Building permits - annual data (2010 = 100)
Expand All @@ -44,8 +45,8 @@ def test_get_sts_cobp_a(self):

idx = pd.date_range("2000-01-01", "2013-01-01", freq="AS", name="TIME_PERIOD")
ne_name = (
"Index, 2010=100",
"Building permits - m2 of useful floor area",
"Index, 2010=100",
"Unadjusted data (i.e. neither seasonally adjusted nor "
"calendar adjusted data)",
"Non-residential buildings, except office buildings",
Expand All @@ -71,8 +72,8 @@ def test_get_sts_cobp_a(self):
ne = pd.Series(ne_values, name=ne_name, index=idx)

uk_name = (
"Index, 2010=100",
"Building permits - m2 of useful floor area",
"Index, 2010=100",
"Unadjusted data (i.e. neither seasonally adjusted nor "
"calendar adjusted data)",
"Non-residential buildings, except office buildings",
Expand Down Expand Up @@ -113,11 +114,11 @@ def test_get_nrg_pc_202(self):
)

name = (
"All taxes and levies included",
"Gigajoule (gross calorific value - GCV)",
"Euro",
"Band D1 : Consumption < 20 GJ",
"Gigajoule (gross calorific value - GCV)",
"Natural gas",
"All taxes and levies included",
"Band D1 : Consumption < 20 GJ",
"Denmark",
"Semi-annual",
)
Expand Down
3 changes: 1 addition & 2 deletions pandas_datareader/tests/test_quandl.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os

import pytest
import pandas as pd
import pytest

from pandas_datareader import data as web
from pandas_datareader.compat import assert_frame_equal


TEST_API_KEY = os.getenv("QUANDL_API_KEY")
# Ensure blank TEST_API_KEY not used in pull request
TEST_API_KEY = None if not TEST_API_KEY else TEST_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ tag_prefix = v

[isort]
known_compat=pandas_datareader.compat.*
sections=FUTURE,COMPAT,STDLIB,THIRDPARTY,PRE_CORE,FIRSTPARTY,LOCALFOLDER
sections=FUTURE,COMPAT,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
known_first_party=pandas_datareader
known_third_party=numpy,pandas,pytest,requests
combine_as_imports=True
Expand Down