Python Forum
Using groupby on non-categorical values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using groupby on non-categorical values
#2
You can filter entire dataframe first, e.g.

animals[(9<animals.height)&(animals.height<10)].groupby("kind").agg(
       min_height=('height', 'min'),
        max_height=('height', 'max'),
      average_weight=('weight', np.mean),
   )
Reply


Messages In This Thread
Using groupby on non-categorical values - by namy77 - Feb-04-2020, 08:37 PM
RE: Using groupby on non-categorical values - by scidam - Feb-04-2020, 11:58 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  change numerical values to categorical names JoeOpdenaker 3 2,938 Nov-02-2020, 01:32 PM
Last Post: DeaD_EyE
  conditional groupby and aggregation on the conditioned group values harrshu 1 2,020 Oct-20-2019, 10:24 AM
Last Post: DeaD_EyE
  'Age' categorical (years -months -days ) to numeric Smiling29 4 2,921 Oct-17-2019, 05:26 PM
Last Post: Smiling29
  categorical encoder Scott 0 2,684 May-19-2018, 03:38 AM
Last Post: Scott

Forum Jump:

User Panel Messages

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