thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

Setting the itemsize of a dtype in dict-style constructor doesn't work (Trac #2200) #5990

Closed numpy-gitbot closed 11 years ago

numpy-gitbot commented 11 years ago

Original ticket http://projects.scipy.org/numpy/ticket/2200 on 2012-08-09 by trac user dpitch40, assigned to unknown.

From a Python 2.7 console session:

import numpy as np dt = np.dtype({"names": ["First"], "formats": [np.uint32], "offsets": [3], "itemsize": 8}) dt.itemsize 7

Obviously the actual itemsize of the dtype doesn't match the one I specified. It appears to set the itemsize to the smallest one that accommodates all of the elements of the type with their offsets. I am using Numpy 1.6.2.

numpy-gitbot commented 11 years ago

atmention:pv wrote on 2012-08-14

It's a new feature added after the 1.6.x Numpy branch.