From f1fba70edd1829c64e3290fa6b1a20d01e9d9674 Mon Sep 17 00:00:00 2001 From: Allan Haldane Date: Tue, 30 Jan 2018 19:15:54 -0500 Subject: ENH: add multi-field assignment helpers in np.lib.recfunctions Adds helper functions for the copy->view transition for multi-field indexes. Adds `structured_to_unstructured`, `apply_along_fields`, `assign_fields_by_name`, `require_fields`. --- numpy/doc/structured_arrays.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'numpy/doc/structured_arrays.py') diff --git a/numpy/doc/structured_arrays.py b/numpy/doc/structured_arrays.py index ab97c5df6..42711a7c0 100644 --- a/numpy/doc/structured_arrays.py +++ b/numpy/doc/structured_arrays.py @@ -443,6 +443,15 @@ behavior since Numpy 1.7. >>> repack_fields(a[['a','c']]).view('i8') # supported 1.15 and 1.16 array([0, 0, 0]) + The :module:`numpy.lib.recfunctions` module has other new methods + introduced in numpy 1.16 to help users account for this change. These are + :func:`numpy.lib.recfunctions.structured_to_unstructured`, + :func:`numpy.lib.recfunctions.unstructured_to_structured`, + :func:`numpy.lib.recfunctions.apply_along_fields`, + :func:`numpy.lib.recfunctions.assign_fields_by_name`, and + :func:`numpy.lib.recfunctions.require_fields`. + + Assigning to an array with a multi-field index will behave the same in Numpy 1.15 and Numpy 1.16. In both versions the assignment will modify the original array:: -- cgit v1.2.1