Skip to content

Feature Group by Time #1006

Open
Open
@jeff-hernandez

Description

@jeff-hernandez

Currently, there isn't a direct way to aggregate features by time intervals. For example, given this dataset of transactions, an expected output can be the total amount on each day.

 ID  Amount                       Time
  0     1.5 2020-06-02 19:06:40.012210
  1     5.0 2020-06-02 10:06:40.012241
  2     2.3 2020-06-02 09:06:40.012252
  3     6.0 2020-06-01 18:06:40.012261
  4     9.0 2020-06-01 13:06:40.012271
  5     3.0 2020-06-01 11:06:40.012280
grouper = pd.Grouper(key='Time', freq='1d')
df.groupby(grouper)['Amount'].sum()
Time
2020-06-01    18.0
2020-06-02     8.8
Freq: D, Name: Amount, dtype: float64

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs designIssues requiring design documentation.new featuresuggestions for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions