Numpy


import numpy



incomes = numpy.random.normal(27000, 15000, 10000)

numpy.mean(incomes)



# %matplotlib inline

import matplotlib.pyplot as pyplot

pyplot.hist(incomes, 50)

pyplot.show()



print numpy.mean(incomes) # 27066

print numpy.median(incomes) # 26820



incomes = numpy.append(incomes, [1000000000])



print numpy.mean(incomes) # 127053

print numpy.median(incomes) # 26822

Leave a Comment