For the statements below, choose the datatype that they describe. It can be either a Python list or a NumPy array.
Tip: Review the NumPy arrays vs. Python lists section closely. Also, remember what the object datatype represents.
For the statements below, choose the datatype that they describe. It can be either a Python list or a NumPy array.
Tip: Review the NumPy arrays vs. Python lists section closely. Also, remember what the object datatype represents.
| List | Array | |
|---|---|---|
| More memory-efficient | ||
| Optimized specifically for computations | ||
| Can be either homogenous or heterogenous | ||
| Slower than the other | ||
| Can only contain the elements of the same type |
Create a free account to access the full topic