Merge pull request #258 from AmitSubhash/fix/q51-structured-dtype-deprecation

Fix exercise 51: deprecated (type, 1) structured dtype -> scalar fields
This commit is contained in:
Nicolas P. Rougier
2026-07-24 15:35:37 +02:00
committed by GitHub

View File

@@ -633,11 +633,11 @@ Create a structured array representing a position (x,y) and a color (r,g,b) (★
hint: dtype hint: dtype
< a51 < a51
Z = np.zeros(10, [ ('position', [ ('x', float, 1), Z = np.zeros(10, [ ('position', [ ('x', float),
('y', float, 1)]), ('y', float)]),
('color', [ ('r', float, 1), ('color', [ ('r', float),
('g', float, 1), ('g', float),
('b', float, 1)])]) ('b', float)])])
print(Z) print(Z)
< q52 < q52