Closed simonhkswan closed 1 year ago
Say you have a Metric and you only know what its Abstract Type is (i.e., Column, TwoColumn, etc.)
Metric
You also have Two Data Frames:
df_a, df_b
Can you write some functions to evaluate the metric. on the dataframes and then provide useful plots of the metrics.
class AvgColumnMetric(DataFrameMetric): """Adapter class""" def __init__(self, metric: ColumnMetric): self._metric = metric self.name = f"avg_{self._metric.name}" def call(df: pd.DataFrame): values = [self._metric(df[col]) for col in df.columns] return np.mean(values)
Column -> value for each column, a colour for each dataframe as a bar chart TwoColumn:
https://datalore.jetbrains.com/notebook/e3ikUrmZAwbbY4rGVg19po/xAkBAmHTr1reqAGXOvhxBB/
Say you have a
Metric
and you only know what its Abstract Type is (i.e., Column, TwoColumn, etc.)You also have Two Data Frames:
df_a, df_b
Can you write some functions to evaluate the metric. on the dataframes and then provide useful plots of the metrics.
Column -> value for each column, a colour for each dataframe as a bar chart TwoColumn: