I am a total newbie to numpy structured arrays.
If I use the code from the docs (see here: Numpy Structured Array)
import numpy as np
x=np.array([(1,2.,'Hello'), (2,3.,"World")], dtype=[('foo', 'i4'),('bar', 'f4'), ('baz', 'S10')])
x
y = x['foo']
y
x is correct: array([(1, 2.0, 'Hello'), (2, 3.0, 'World')], dtype=[('foo', '<i4'), ('bar', '<f4'), ('baz', 'S10')])
However y gives me array([1, 2]) and the docs say it should be array([ 2., 3.], dtype=float32)
I have a hard time believing the docs are wrong but this code is so short and and I copied/pasted it into python.
Am I doing something wrong?