Foundations-of-Computer-Science practice question 6 of 15

Which aspect is excluded from a NumPy array’s structure?

Full set: 71 questions
Answer options
A:

A. The data pointer

B:

B. The shape of the array

C:

C. The data type or dtype pointer

D:

D. The encryption key of the array

Correct answer
Correct Answer:
D. D. The encryption key of the array
Explanation

A NumPy ndarray object is a data structure that consists of a pointer to a contiguous block of memory (the data) and metadata used to interpret that data. This metadata fundamentally includes the data type (dtype), the array's dimensions (shape), and information on how to traverse the data (strides). An encryption key is not a standard component of the NumPy array's internal structure. While a NumPy array's data can be encrypted through external libraries or custom implementations, encryption is not an intrinsic property or attribute of the ndarray object itself.

Why Incorrect

A. The data pointer is a core component, pointing to the memory location where the array's elements are actually stored.
B. The shape of the array is essential metadata, defining the size of the array in each dimension as a tuple of integers.
C. The data type or dtype is a fundamental attribute that describes the type of data (e.g., int32, float64) stored in the array.

References

1. NumPy v1.26 Manual, "NumPy fundamentals," Section: "The N-dimensional array (ndarray)." The documentation describes the internal memory layout and essential attributes of an ndarray, which include ndarray.shape, ndarray.dtype, and a pointer to the data buffer, but makes no mention of an encryption key. (Source: Official Vendor Documentation)

2. Harris, C. R., Millman, K. J., van der Walt, S. J., et al. (2020). Array programming with NumPy. Nature, 585, 357–362. https://doi.org/10.1038/s41586-020-2649-2. The paper describes the NumPy array as a "multidimensional, homogeneous array of fixed-size items" and discusses its core components like shape and dtype.

3. Stanford University, CS231n: "Convolutional Neural Networks for Visual Recognition," Python/Numpy Tutorial. The tutorial explains the ndarray object, highlighting its key attributes like shape, dtype, and size, without any mention of encryption as a built-in feature. (Source: University Courseware)

Scroll to Top