New Features of NumPy


This list tries to summarize a few of the new features of NumPy.   There are more new features than these, however. 
  1. More data types (all standard C-data types plus complex floats, boolean, string, unicode, and void *).
  2. Flexible data types where each array can have a different itemsize (but all elements of the same array still have the same itemsize).
  3. Data types are true Python objects
  4. Data types have a type attribute that is a typeobject placing the data-type in a hierarchy of data-types.
  5. Named fields are supported intrinsically on arrays.  Record arrays allow named-field access using attributes.
  6. Many more array methods in addition to functional counterparts.
  7. Attributes more clearly distinguished from methods (attributes are intrinsic parts of an array so that setting them changes the array itself).
  8. Array scalars covering all data types which inherit from Python scalars when appropriate.
  9. Arrays can be misaligned, swapped, and in Fortran order in memory (facilitates memory-mapped arrays).
  10. Arrays can be more easily read from text files and created from buffers.
  11. Arrays can be quickly written to files in text and/or binary mode.
  12. Fancy indexing can be done on arrays using integer sequences and boolean masks.
  13. Coercion rules are altered for mixed scalar / array operations so that scalars (anything that produces a 0-dimensional array internally) will not determine the output type in such cases.
  14. When coercion is needed, temporary buffer-memory allocation is limited to a user-adjustable size.
  15. Errors are handled through the IEEE floating point status flags and there is flexibility on a per function / module / builtin level for handling these errors.
  16. One can register an error callback function in Python to handle errors which are set to 'call' for their error handling;
  17. Ufunc reduce, accumulate, and reduceat can take place using a different type then the array type if desired (without copying the entire array);
  18. Ufunc output arrays passed in can be a different type than expected from the calculation.
  19. Arbitrary classes can be passed through ufuncs (using __array_wrap__ and __array_priority__).
  20. Ufuncs can be easily created from Python functions.
  21. Ufuncs have attributes to detail their behavior, including a dynamic doc string that automatically generates the calling signature.
  22. Several new ufuncs (frexp, modf, ldexp, isnan, isfinite, isinf, signbit).
  23. New types can be registered with the system so that specialized ufunc loops can be written for fast support of new type objects.
  24. C-API enhanced so that more of the functionality is available from extension modules.
  25. C-API enhanced so array structure access can take place through macros.
  26. New iterator objects created for easy handling in C of discontiguous arrays.
  27. Types have more functions associated with them (no magic function lists in the C-code). Any function needed is part of the type structure.