home.social

Search

2 results for “RSESam”

  1. Using resample in ? You'll want a list of "offset aliases," the codes that let you specify units.

    Some are surprising, such as "ME" and "MS" for "month end" and "month start".

    They're at: pandas.pydata.org/docs/user_gu

  2. Using "resample" groups a data frame with a datetime index with arbitrary time units, similar to Grouper.

    For example, mean total_amount every 8-hours:

    df.resample('8h')['total_amount'].mean()

    Or tip_amount per day:

    df.resample('1D')['tip_amount'].mean()

Share on Mastodon

Enter the server where you have an account.