@@ -3,14 +3,15 @@ NumPy 1.8.0 Release Notes
3
3
4
4
This release supports Python 2.6 -2.7 and 3.2 - 3.3.
5
5
6
-
7
6
Highlights
8
7
==========
9
8
10
- Python 2 and Python 3 are supported by the same code base. The
11
- 2to3 fixer is no longer run.
12
-
13
-
9
+ * Python 2 and Python 3 are supported by the same code base. The
10
+ 2to3 fixer is no longer run.
11
+ * ``full `` and ``full_like `` to create value initialized arrays.
12
+ * ``partition `` partial sorting via selection.
13
+ * inplace fancy indexing for ufuncs with the ``.at `` method.
14
+ * Numerous performance improvements in many areas.
14
15
15
16
Dropped Support
16
17
===============
@@ -178,7 +179,8 @@ Advanced indexing using `np.newaxis`
178
179
179
180
It is now possible to use `np.newaxis `/`None ` together with index
180
181
arrays instead of only in simple indices. This means that
181
- ``array[np.newaxis, [0, 1]] `` will now work as expected.
182
+ ``array[np.newaxis, [0, 1]] `` will now work as expected and select the first
183
+ two rows while prepending a new axis to the array.
182
184
183
185
New functions `full ` and `full_like `
184
186
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -191,11 +193,17 @@ New functions `partition` and `argpartition`
191
193
192
194
New functions to partially sort arrays via a selection algorithm.
193
195
194
- Partial sorting moves the value of selected elements into their position if the
195
- array would be sorted. In the resulting array all elements smaller than the
196
- sorted elements will placed before the it and all equal or greater behind it.
197
- This has a linear time complexity of ``O(n) `` compared to ``O(n log(n)) `` of a
198
- full sort.
196
+ A ``partition `` by index ``k `` moves the ``k `` smallest element to the front of
197
+ an array. All elements before ``k `` are then smaller or equal than the value
198
+ in position ``k `` and all elements following ``k `` are then greater or equal
199
+ than the value in position ``k ``. The ordering of the values within these
200
+ bounds is undefined.
201
+ A sequence of indices can be provided to sort all of them into their sorted
202
+ position at once iterative partitioning.
203
+ This can be used to efficiently obtain order statistics like median or
204
+ percentiles of samples.
205
+ ``partition `` has a linear time complexity of ``O(n) `` while a full sort has
206
+ ``O(n log(n)) ``.
199
207
200
208
New functions `nanmean `, `nanvar ` and `nanstd `
201
209
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -285,6 +293,22 @@ reduces its time complexity from O(n log(n)) to O(n).
285
293
If used with the `overwrite_input ` option the array will now only be partially
286
294
sorted instead of fully sorted.
287
295
296
+
297
+ Overrideable operand flags in ufunc C-API
298
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
299
+ When creating a ufunc, the default ufunc operand flags can be overridden
300
+ via the new op_flags attribute of the ufunc object. For example, to set
301
+ the operand flag for the first input to read/write:
302
+
303
+ PyObject \* ufunc = PyUFunc_FromFuncAndData(...);
304
+ ufunc->op_flags[0] = NPY_ITER_READWRITE;
305
+
306
+ This allows a ufunc to perform an operation in place. Also, global nditer flags
307
+ can be overridden via the new iter_flags attribute of the ufunc object.
308
+ For example, to set the reduce flag for a ufunc:
309
+
310
+ ufunc->iter_flags = NPY_ITER_REDUCE_OK;
311
+
288
312
Changes
289
313
=======
290
314
@@ -327,8 +351,6 @@ One new function has been added to the ufunc C-API that allows to register
327
351
an inner loop for user types using the descr.
328
352
* PyUFunc_RegisterLoopForDescr
329
353
330
-
331
-
332
354
Deprecations
333
355
============
334
356
@@ -342,24 +364,3 @@ deprecated. Previously float indices and function arguments such as axes or
342
364
shapes were truncated to integers without warning. For example
343
365
`arr.reshape(3., -1) ` or `arr[0.] ` will trigger a deprecation warning in
344
366
NumPy 1.8., and in some future version of NumPy they will raise an error.
345
-
346
- C-API
347
- ~~~~~
348
-
349
- None
350
-
351
- New Features
352
- ============
353
-
354
- When creating a ufunc, the default ufunc operand flags can be overridden
355
- via the new op_flags attribute of the ufunc object. For example, to set
356
- the operand flag for the first input to read/write:
357
-
358
- PyObject \* ufunc = PyUFunc_FromFuncAndData(...);
359
- ufunc->op_flags[0] = NPY_ITER_READWRITE;
360
-
361
- This allows a ufunc to perform an operation in place. Also, global nditer flags
362
- can be overridden via the new iter_flags attribute of the ufunc object.
363
- For example, to set the reduce flag for a ufunc:
364
-
365
- ufunc->iter_flags = NPY_ITER_REDUCE_OK;
0 commit comments