def concat_pysus(ufs, y_begin, y_end): pieces = [] for y in range(y_begin, y_end + 1): for m in range(1, 13): for uf in ufs: df = download(uf, month=m, year=y) if df is not None: pieces.append(df) result = pd.concat(pieces, ignore_index=True) return result
def test_download(self): df = download('to', 2009, 12) df2 = download('AC', 2013, 10) self.assertGreater(len(df), 0) self.assertGreater(len(df2), 0) self.assertIsInstance(df, pd.DataFrame)
def test_download_pre_2008(self): df = download('AC', 2006, 12, cache=False) assert not df.empty
def test_download_2008(self): df = download('SE', 2008, 6, cache=False) assert not df.empty
def test_download(self): df = download('to', 2009, 12) df2 = download('AC', 2013, 10) self.assertGreater(len(df), 0) self.assertGreater(len(df2), 0) self.assertIsInstance(df, pd.DataFrame)