Skip to content

Alternative for 06_Stats/Wind_Stats/Step 12-14 #103

@chenjj28

Description

@chenjj28

From step12 to 14, it asked to downsample the record to a yearly/monthly/weekly frequency for each location.
The provided solution is like below:
data.groupby(data.index.to_period('A')).mean()

I think it would be simpler to use resample function as below:
data.resample('AS').mean()
data.resample('M').mean()
data.resample('W').mean()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions