NumPy 5: Counting using NumPy

Опубликовано: 15 Май 2026
на канале: Christopher Davis, UC Irvine
204
0

Python notes for Math 9:
https://christopherdavisuci.github.io...

Python playlists for Math 9:
Python data types:    • Python data types  
Alternating list:    • Alternating list  
NumPy:    • NumPy  
Pythonic code:    • Pythonic code  
Matplotlib:    • Matplotlib  
Newton's Method:    • Newton's Method  
Pillow image processing:    • Pillow image processing  
Brief introduction to object-oriented programming:    • Brief introduction to object-oriented prog...  

00:00 Explanation of the problem
0:30 Recap of random numbers in NumPy
2:57 Counting integers less than 10 (list version)
5:48 Counting integers less than 10 (array version)
7:18 np.nonzero()
8:24 Creating a new array with only integers less than 10
10:09 The probability estimate
12:24 Timing the computation