Skip to content Skip to sidebar Skip to footer

Access Line By Line To A Numpy Structured Array

I am trying to access to a structured array line by line by iterating on the values of one field of it but even if the value iterate well, the slice of the array doesn't change. He

Solution 1:

The last line is not right. The array index evaluates to True or False rather than doing a lookup of a named column. Try this:

for n in a['name']:
    print n,a[a['name']==n]

Post a Comment for "Access Line By Line To A Numpy Structured Array"