Numpy Fundamentals | 20/100 Days of Python Algo Trading

Congratulations on reaching this stage!

If you’re here, it means you’re truly dedicated to mastering Python. Directly below, you’ll find a quiz designed to help you reinforce what you’ve just learned. This isn’t just about recalling facts; it’s about deeply understanding the concepts. Take a moment to answer the questions and see how well you can apply the knowledge from the video. You’re doing great—every question you tackle brings you one step closer to becoming a Python expert!

Day 20: Numpy Fundamentals

1. What is NumPy?
2. How do NumPy arrays differ from Python lists?
3. What are common use cases of NumPy in algorithmic trading?
4. How can you create a NumPy array?
5. Which attribute of a NumPy array returns the number of array dimensions?
6. How do you change the datatype of a NumPy array?
7. What operation would you use to add two NumPy arrays?
8. Which NumPy function would you use to calculate the mean across a single dimension of a multi-dimensional array?
9. How do you initialize a NumPy array of zeros with shape (3,4)?
10. What does the reshape method do to an array?
11. Which of the following operations is element-wise between two compatible NumPy arrays?
12. What error is raised when you attempt operations on arrays with incompatible shapes?
13. Which function helps in joining a sequence of arrays along a new axis?
14. How would you select elements from a NumPy array that are greater than 10?
15. What is the correct way to invert the values in a boolean array?
16. Which method explicitly broadcasts an array to a new shape?
17. How do you check the memory usage of a NumPy array?
18. Which method is used to flatten a multi-dimensional array into a single dimension?
19. What would np.linspace(0, 10, 5) return?
20. Which function is used to save a NumPy array to a binary file in .npy format?