microsoft / datamations

https://microsoft.github.io/datamations/
Other
66 stars 14 forks source link

Three-variable grouping in Python #132

Closed jhofman closed 2 years ago

jhofman commented 2 years ago

@chisingh will work on a three-variable grouping example.

@sharlagelfand, can you add the spec from the shiny app example here?

sharlagelfand commented 2 years ago

@chisingh Here is an example spec grouping the penguin data by three grouping variables and getting the mean bill_length_mm.

It uses the palmerpenguins dataset, looks like there's also a python version of the package! The datamations package itself doesn't contain the penguins data set, but rather shows loading palmerpenguins and using the data from there, so might be good to try out using an external data set in the python version too.

R code for the operation:

library(palmerpenguins)
library(dplyr)

penguins %>%
  group_by(species, island, sex) %>%
  summarize(mean = mean(bill_length_mm))
sharlagelfand commented 2 years ago

Just a thought for testing, it would be good to generate the groups in a different order (e.g. species, island, sex vs island, sex, species) and also test generating the mean of different columns (there's bill length, bill depth, etc).

chisingh commented 2 years ago

Closed by #162