Saved Bookmarks
| 1. |
How do we check for an empty array (or zero elements array)? |
|
Answer» We can check for the emptiness of a NumPy array by making use of the size attribute. arr = np.zeros((1,0)) #returns empty array print(arr.size) #returns 0 This return 0 |
|