Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d15f21

Browse files
committed
Remove mlab.norm_flat
1 parent c26f1d6 commit 2d15f21

3 files changed

Lines changed: 2 additions & 19 deletions

File tree

doc/api/next_api_changes/2018-09-18-DS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ in Matplotlib 2.2 has been removed. See below for a list:
1010
- `mlab.rms_flat`
1111
- `mlab.l1norm` (use ``numpy.linalg.norm(a, ord=1)`` instead)
1212
- `mlab.l2norm` (use ``numpy.linalg.norm(a, ord=2)`` instead)
13+
- `mlab.norm_flat` (use ``numpy.linalg.norm(a.flat, ord=2)`` instead)
1314
- `mlab.cohere_pairs` (use scipy.signal.coherence instead)
1415
- `mlab.entropy` (use scipy.stats.entropy instead)
1516
- `mlab.normpdf` (use scipy.stats.norm.pdf instead)

lib/matplotlib/mlab.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,24 +1247,6 @@ def movavg(x, n):
12471247
"""
12481248

12491249

1250-
@cbook.deprecated("2.2", alternative='numpy.linalg.norm(a.flat, ord=p)')
1251-
def norm_flat(a, p=2):
1252-
"""
1253-
norm(a,p=2) -> l-p norm of a.flat
1254-
1255-
Return the l-p norm of *a*, considered as a flat array. This is NOT a true
1256-
matrix norm, since arrays of arbitrary rank are always flattened.
1257-
1258-
*p* can be a number or the string 'Infinity' to get the L-infinity norm.
1259-
"""
1260-
# This function was being masked by a more general norm later in
1261-
# the file. We may want to simply delete it.
1262-
if p == 'Infinity':
1263-
return np.max(np.abs(a))
1264-
else:
1265-
return np.sum(np.abs(a) ** p) ** (1 / p)
1266-
1267-
12681250
@cbook.deprecated("2.2", 'numpy.arange')
12691251
def frange(xini, xfin=None, delta=None, **kw):
12701252
"""

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
demean, detrend, detrend_linear, detrend_mean, detrend_none,
234234
frange,
235235
identity, ispower2, isvector,
236-
log2, movavg, norm_flat,
236+
log2, movavg,
237237
window_hanning, window_none)
238238

239239
from matplotlib import cbook, mlab, pyplot as plt

0 commit comments

Comments
 (0)