lundi 14 octobre 2019

Pandas/Python how to create an average for specif variable values?

I am new using Pandas/python and I would like to know, when I have a dataset, how I can create an average from a variable, volume, for each value of another variable, price, if variable hour is between some specific values, lets say 1 to 10. To understand better what I have is the following:

excel-columns

I what I want to obtain is the following price and volume columns in green; which are the average of volume for each price when 1<=hour<=10.

result

I would really appreciate your help!

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire