Fail gracefully from plot-profit when no data is provided

closes #6132
This commit is contained in:
Matthias
2021-12-30 10:14:45 +01:00
parent 77afb7b5e2
commit bd98637ae9
3 changed files with 14 additions and 1 deletions

View File

@@ -325,6 +325,7 @@ def combine_dataframes_with_mean(data: Dict[str, pd.DataFrame],
:param column: Column in the original dataframes to use
:return: DataFrame with the column renamed to the dict key, and a column
named mean, containing the mean of all pairs.
:raise: ValueError if no data is provided.
"""
df_comb = pd.concat([data[pair].set_index('date').rename(
{column: pair}, axis=1)[pair] for pair in data], axis=1)