panda dataframe consolidate multiple rows using average code example Example: combine df columns python df["period"] = df["Year"] + df["quarter"]