Python Forum
how to: explicitly select the grouping columns after groupby
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to: explicitly select the grouping columns after groupby
#1
backtestdf_complete.groupby(['b_index', 'sample_dur']).apply(day_test)
That bit of code is throwing me:

Output:
/Volumes/Python/findparams.py:123: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning. backtestdf_complete.groupby(['b_index', 'sample_dur']).apply(day_test, include_groups=True)
So I need my grouping columns to be included in the operation. So per the warning I'm guessing I can "explicitly select the grouping columns after groupby" - but how do I do that? I cannot find an example... thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Grouping Data based on 30% bracket purnima1 4 1,258 Mar-10-2023, 07:38 PM
Last Post: deanhystad
  Grouping and sum of a list of objects Otbredbaron 1 3,294 Oct-23-2021, 01:42 PM
Last Post: Gribouillis
  Why can't I explicitly call __bool__() on sequence type? quazirfan 11 4,778 Aug-20-2021, 06:49 AM
Last Post: Gribouillis
  Grouping and summing of dataset jef 0 1,679 Oct-04-2020, 11:03 PM
Last Post: jef
  Grouping algorithm riccardoob 7 3,115 May-19-2020, 01:22 PM
Last Post: deanhystad
  Help Grouping by Intervals on list paul41 1 2,194 Dec-03-2019, 09:43 PM
Last Post: michael1789
  Grouping a list of various time into intervals paul41 1 3,825 Nov-24-2019, 01:47 PM
Last Post: buran
  resample grouping pr0blem olufemig 1 2,010 Nov-06-2019, 10:45 PM
Last Post: Larz60+
  Binding not explicitly declared happening karkas 4 2,930 Aug-05-2019, 05:09 PM
Last Post: karkas
  Splitting lines ang grouping three at once samsonite 5 2,846 Jun-21-2019, 05:19 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020