Skip to content

[Question] How to get first and last data using group by #521

Description

@tarikhagustia

hi i'm looking for this solution https://stackoverflow.com/questions/62373692/how-do-you-convert-1-minute-open-high-low-close-data-to-another-timeframefx-5 using this library. but i can't find first and last data grouping.

Activity

  1. steveoni commented on Nov 22, 2022

    @steveoni
    Member

    @tarikhagustia

    for any groupby variable you should be able to do this

    let grpby = df.groupby("column")
    grpby.first() // first of the grouping
    grpby.last() // last of the grouping
  2. tarikhagustia commented on Nov 22, 2022

    @tarikhagustia
    Author

    @tarikhagustia

    for any groupby variable you should be able to do this

    let grpby = df.groupby("column")
    grpby.first() // first of the grouping
    grpby.last() // last of the grouping

    but how to use in .agg function?

  3. locked and limited conversation to collaborators on Apr 3, 2025
  4. converted this issue into a discussion #663 on Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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