@@ -16,19 +16,23 @@ Highlights
16
16
evaluation order.
17
17
* Addition of `nanprod ` to the set of nanfunctions.
18
18
19
+ Dropped Support:
19
20
20
- Dropped Support
21
- ===============
22
21
* The polytemplate.py file has been removed.
23
22
* The _dotblas module is no longer available.
24
23
* The testcalcs.py file has been removed.
25
24
25
+ Future Changes:
26
26
27
- Future Changes
28
- ==============
27
+ * In array comparisons like ``arr1 == arr2 ``, many corner cases
28
+ involving strings or structured dtypes that used to return scalars
29
+ now issue ``FutureWarning `` or ``DeprecationWarning ``, and in the
30
+ future will be change to either perform elementwise comparisons or
31
+ raise an error.
29
32
* The SafeEval class will be removed.
30
33
* The alterdot and restoredot functions will be removed.
31
34
35
+ See below for more details on these changes.
32
36
33
37
Compatibility notes
34
38
===================
@@ -250,6 +254,41 @@ array is writeable.
250
254
Deprecations
251
255
============
252
256
257
+ Array comparisons involving strings or structured dtypes
258
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259
+
260
+ Normally, comparison operations on arrays perform elementwise
261
+ comparisons and return arrays of booleans. But in some corner cases,
262
+ especially involving strings are structured dtypes, NumPy has
263
+ historically returned a scalar instead. For example::
264
+
265
+ ### Current behaviour
266
+
267
+ np.arange(2) == "foo"
268
+ # -> False
269
+
270
+ np.arange(2) < "foo"
271
+ # -> True on Python 2, error on Python 3
272
+
273
+ np.ones(2, dtype="i4,i4") == np.ones(2, dtype="i4,i4,i4")
274
+ # -> False
275
+
276
+ Continuing work started in 1.9, in 1.10 these comparisons will now
277
+ raise ``FutureWarning `` or ``DeprecationWarning ``, and in the future
278
+ they will be modified to behave more consistently with other
279
+ comparison operations, e.g.::
280
+
281
+ ### Future behaviour
282
+
283
+ np.arange(2) == "foo"
284
+ # -> array([False, False])
285
+
286
+ np.arange(2) < "foo"
287
+ # -> error, strings and numbers are not orderable
288
+
289
+ np.ones(2, dtype="i4,i4") == np.ones(2, dtype="i4,i4,i4")
290
+ # -> [False, False]
291
+
253
292
SafeEval
254
293
~~~~~~~~
255
294
The SafeEval class in numpy/lib/utils.py is deprecated and will be removed
0 commit comments