How to get average of rows, columns in a Numpy array

mean value Numpy array on a row or column

--

To get the mean value, you first need to know that axis 1 is assumed as row and axis 0 is assumed as column.

a is an array, so:

np.mean(a, axis=0)

or

np.mean(a, axis=1)

depending on what axis you want to average on.

example:

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Panjeh
Panjeh

Written by Panjeh

Posting about Python and Laravel

No responses yet

Write a response