Define C-style struct records with named fields and heterogeneous dtypes.
Structured arrays allow storing complex C-style records with named fields (e.g. `name`, `age`, `salary`) with different data types inside a single contiguous array buffer.
A structured array is a C-struct in Python: each row is a record holding multiple typed columns stored side-by-side in continuous memory.
Fields are defined with `(field_name, format_code)`: `'U10'` (Unicode string 10 chars), `'i4'` (int32), `'f8'` (float64).
dt = np.dtype([('id', 'i4'), ('score', 'f8')])students[0]['gpa'] # Row-first lookupstudents['gpa'][0] # Column-first lookup (much faster in NumPy)Accessing by column `students['gpa']` returns a contiguous vector, which is faster and vectorized.
Solve the objective below using NumPy vectorized syntax
Define `dt = np.dtype([('name', 'U10'), ('age', 'i4')])`, create `arr = np.array([('Alice', 25)], dtype=dt)`, and print `arr['name']`.
['Alice']