Chapter 2: Python and Essential Libraries for Data Science
Question 5:
What is the main advantage of using NumPy arrays over Python lists in machine learning?
a) NumPy arrays can store mixed data types, while lists cannot.
b) NumPy arrays are more memory-efficient and support faster numerical computations.
c) Python lists are faster than NumPy arrays for mathematical operations.
d) NumPy arrays are limited to two dimensions, while lists can store multi-dimensional data.
Question 6:
How do you reshape a 1D NumPy array into a 2D array with 3 rows and 2 columns?
a) array.reshape((2, 3))
b) array.reshape((3, 2))
c) array.reshape((3))
d) array.reshape((2, 1, 3))
Question 7:
Which Pandas function is used to detect missing values in a DataFrame?
a) ...