def test_df2accordion_single(): df = pd.DataFrame(np.array([1]), columns=["a"]) def func_fig(data): fig = plt.figure(figsize=(10, 5)) plt.plot(data) return fig df2accordion(df=df, by="a", func=func_fig)
def test_df2accordion(): df = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), columns=["a", "b", "c"]) def func_fig(data): fig = plt.figure(figsize=(10, 5)) plt.plot(data) return fig df2accordion(df=df, by="a", func=func_fig)