Finding the mean and standard deviation of a timedelta object in pandas df

前端 未结 4 1543
太阳男子
太阳男子 2020-12-16 11:29

I would like to calculate the mean and standard deviation of a timedelta by bank from a dataframe with two columns shown

4条回答
  •  無奈伤痛
    2020-12-16 12:21

    Pandas mean() and other aggregation methods support numeric_only=False parameter.

    dropped.groupby('bank').mean(numeric_only=False)
    

    Found here: Aggregations for Timedelta values in the Python DataFrame

提交回复
热议问题