9951 explained code solutions for 126 technologies


python-numpySimple Numpy usage example


import numpy as np

a = np.array([1, 3, 5, 9])

mean_a = a.mean()
print(mean_a)ctrl + c
import numpy as np

load Numpy module for Python

np.array

declare Numpy array

[1, 3, 5, 9]

sample array to create

.mean

find mean for given array

print(mean_a)

output found mean value