Answers for "python code for average"

5

python average

def avrg(values): # where values is a list of all values
  return sum(values)/len(values)
Posted by: Guest on March-27-2021
0

average python

import numpy as np
values=[1,10,100]
print(np.mean(values))
values=[1,10,100,np.nan]
print(np.nanmean(values))
Posted by: Guest on March-21-2020

Python Answers by Framework

Browse Popular Code Answers by Language