Skip to content
Advertisement

Groupby mean doesn’t display all data

I want to see all the means of the numerical columns, grouped by position, using

JavaScript

When I do this I only get 3 of the many columns

enter image description here

The other columns are all integers or floats, and they have no NAs.

If I do

JavaScript

Then I get the correct output. How can I display weight using groupby?

Thanks for any help

Advertisement

Answer

You can try using the Aggregate function on groupby.

For example:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement