def summary_statistics(factor_data: pd.DataFrame) -> pd.DataFrame: storage = [] for name, group in factor_data['factor'].groupby('date'): content = descriptivestats.describe(group).T content.index = [name] storage.append(content) cross_section_info = pd.concat(storage) return cross_section_info
def test_describe(df): pd.testing.assert_frame_equal(describe(df), Description(df).frame)