Esempio n. 1
0
def test_midc_format_index():
    data = pd.read_csv(midc_testfile)
    data = midc.format_index(data)
    start = pd.Timestamp("20181014 00:00")
    start = start.tz_localize("MST")
    end = pd.Timestamp("20181014 23:59")
    end = end.tz_localize("MST")
    assert type(data.index) == pd.DatetimeIndex
    assert data.index[0] == start
    assert data.index[-1] == end
Esempio n. 2
0
def test_midc_format_index_tz_conversion():
    data = pd.read_csv(midc_testfile)
    data = data.rename(columns={'MST': 'PST'})
    data = midc.format_index(data)
    assert data.index[0].tz == pytz.timezone('Etc/GMT+8')