Skip to content

document comparison with python pandas resample #56

@myoung3

Description

@myoung3

perhaps in a vignette?
https://towardsdatascience.com/using-the-pandas-resample-function-a231144194c4

There are similarities between resample and intervalaverage,

  • resample is quite a bit less flexible in that it only resamples to regular, pre-specified periods. intervalaverage resamples to arbitrary periods and they don't need to be regular (or even non-overlapping).
  • resample doesn't seem to resample to different periods for different subsets. This flexibility is useful, for example, if you want to calculate a different time-average for different individuals. (for example, taking an average of air pollution in the 365 days prior to each individual's death)
  • On the other hand intervalaverage requires specification of the desired periods, so it lacks the convenience of resample for those specific cases.
  • Additionally, resample allows left, right, or completely open intervals. intervalaverage assumes completely closed intervals. This difference makes sense because intervalaverage was designed specifically for data measured over intervals, possibly irregular intervals. Resample is stored via a single column. Intervalaverage data requires start and end times to be stored as separate columns, so the user can add/subtract 1 to the start and ends to specify intervals which are both inclusive and correspond to the desired interval.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions