Skip to content

DOC: groupby by indexer to 'resample' data #13271

@tomchor

Description

@tomchor

Related to this question.

I would like to propose either to expand .resample to work on indexes that are integers or to create another method that does the same thing (maybe more general .upsample and .downsample methods).

If it was implemented as an expansion of resample I imagine something like:

df = pd.DataFrame(np.random.randn(10,2))
df.resample(5, np.std)

Which would produce:

          0         1
0  1.184582  0.492113
5  0.533134  0.982562

which is a pretty forward downsample case. For upsampling maybe some discussion is needed on how to return the indexes.

This should be simple to program and I think it would be a very useful shortcut.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions