NumPy - Creating Arrays
You want to create a zero-filled 2D array with 3 rows and 4 columns, but the array must store boolean values. Which code is correct?
(3,4) is correct.dtype, and bool is valid to create boolean arrays.type instead of dtype, passing shape as separate arguments like np.zeros(3,4, dtype=bool) without tuple parentheses, using a list [3,4] instead of tuple.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions