Omniadisce

Computational physics 4.3: Many times at once: np.linspace

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 15 min

By the end you can

  • Make evenly spaced numbers with np.linspace(start, stop, how many)
  • Say why np.linspace(0, 2, 5) has a gap of 0.5, not 0.4
  • Work out the gap between the numbers: (stop โˆ’ start) รท (how many โˆ’ 1)
  • Make a free-fall table for 100 times in two lines

Who it is for: Anyone who has done lesson 4.2 (arithmetic on whole arrays).

The steps

  1. Five times from 0 to 2
  2. np.linspace(start, stop, how many)
  3. Your first linspace
  4. The gap between the numbers
  5. 101 times
  6. Your own times
  7. A table for 100 times
  8. A fall, in two lines
  9. How much is printed?
  10. Why 101?

Discussion 0 comments

Log in to join the discussion.

× Enlarged view