Skip to content
Advertisement

How to calculate average percentages of values within group?

I have a dataframe:

JavaScript

I want to calculate percentage of each ‘type’ within date group and then average values among all dates. So desired results must be:

JavaScript

and then average among all dates. this is the desired final result:

JavaScript

How to do that?

Advertisement

Answer

You can try this:

JavaScript

or this:

JavaScript

It’s not quite clear by your question

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