Trusted answers to developer questions

Shreya mattegunta

In NumPy, we use special inbuilt functions to compute mean, standard deviation, and variance.

The **mean** gives the arithmetic mean of the input values. It is the sum of elements divided by the total number of elements. It is given by the syntax `numpy.mean()`

or `np.mean()`

.

import numpy as np array = np.arange(20) print(array) r1 = np.mean(array) print("\nMean: ", r1)

The **median** gives the middle values in the given array. Its syntax is given by `np.median()`

.

import numpy as np array = np.arange(20) print(array) r1 = np.median(array) print("\nstd: ", r1)

The **standard deviation** gives us the spread of distribution of array values. Standard deviation is given by the syntax `np.std()`

or `numpy.std()`

.

import numpy as np array = np.arange(20) print(array) r1 = np.std(array) print("\nstd: ", r1)

RELATED TAGS

communitycreator

python

numpy

CONTRIBUTOR

Shreya mattegunta

RELATED COURSES

View all Courses

Keep Exploring

Related Courses