Omniadisce

Computational physics 4.4: Sum, mean and max of an array

Lesson Beginner

Join free to take this lesson

Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.

10 steps ยท about 20 min

By the end you can

  • Add up an array with np.sum
  • Find the mean of measurements with np.mean, and say why it is the sum รท len
  • Find the biggest and smallest elements with np.max and np.min, and the spread between them
  • Work out an average speed as total distance รท total time

Who it is for: Anyone who has done lesson 4.3 (np.linspace).

The steps

  1. Adding up with a loop (a recap)
  2. A trip in legs
  3. np.mean: the average
  4. The mean fall time
  5. The same as the mean
  6. np.max and np.min
  7. The spread of the times
  8. An average speed, done right
  9. A walk's average speed
  10. Which average?

Discussion 0 comments

Log in to join the discussion.

× Enlarged view