Adding a field to a structured numpy array (2)

http://projects.scipy.org/numpy/browser/branches/1.3.x/numpy/lib/recfunctions.py?rev=8229 did you import? from numpy.lib import recfunctions recfunctions.append_fields(*your_args) # base, names, data, … Seems like everything is working: Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) [GCC 4.4.5] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. >>> import numpy >>> numpy.__version__ ‘1.3.0’ >>> from numpy.lib.recfunctions import append_fields >>> append_fields <function append_fields at … Read more

Convert structured array to regular NumPy array

The simplest method is probably x.view((float, len(x.dtype.names))) (float must generally be replaced by the type of the elements in x: x.dtype[0]). This assumes that all the elements have the same type. This method gives you the regular numpy.ndarray version in a single step (as opposed to the two steps required by the view(…).reshape(…) method.