Commit 8c500838 authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

testutils: expose a `hist_to_df` utility

Convenient to have an history as a dataframe.
parent 12ec9d4f570b
......@@ -22,13 +22,17 @@ def assert_df(expected, df):
assert exp == got
def assert_hist(expected, dfdict):
def hist_to_df(dfdict):
# copy to avoid side effects
series = [(key, serie.copy()) for key, serie in dfdict.items()]
for revdate, serie in series:
inject_in_index(serie, revdate)
series = pd.concat([serie for _, serie in series])
return pd.concat([serie for _, serie in series])
def assert_hist(expected, dfdict):
series = hist_to_df(dfdict)
assert_df(expected, series)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment