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

Skip to content

Commit d776826

Browse files
committed
Remove mlab.entropy
1 parent 5d7fbc7 commit d776826

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ in Matplotlib 2.2 has been removed. See below for a list:
66

77
- `mlab.logspace` (use numpy.logspace instead)
88
- `mlab.cohere_pairs` (use scipy.signal.coherence instead)
9+
- `mlab.entropy` (use scipy.stats.entropy instead)
910
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,36 +1194,6 @@ def cohere(x, y, NFFT=256, Fs=2, detrend=detrend_none, window=window_hanning,
11941194
return Cxy, f
11951195

11961196

1197-
@cbook.deprecated('2.2', 'scipy.stats.entropy')
1198-
def entropy(y, bins):
1199-
r"""
1200-
Return the entropy of the data in *y* in units of nat.
1201-
1202-
.. math::
1203-
1204-
-\sum p_i \ln(p_i)
1205-
1206-
where :math:`p_i` is the probability of observing *y* in the
1207-
:math:`i^{th}` bin of *bins*. *bins* can be a number of bins or a
1208-
range of bins; see :func:`numpy.histogram`.
1209-
1210-
Compare *S* with analytic calculation for a Gaussian::
1211-
1212-
x = mu + sigma * randn(200000)
1213-
Sanalytic = 0.5 * ( 1.0 + log(2*pi*sigma**2.0) )
1214-
"""
1215-
n, bins = np.histogram(y, bins)
1216-
n = n.astype(float)
1217-
1218-
n = np.take(n, np.nonzero(n)[0]) # get the positive
1219-
1220-
p = np.divide(n, len(y))
1221-
1222-
delta = bins[1] - bins[0]
1223-
S = -1.0 * np.sum(p * np.log(p)) + np.log(delta)
1224-
return S
1225-
1226-
12271197
@cbook.deprecated('2.2', 'scipy.stats.norm.pdf')
12281198
def normpdf(x, *args):
12291199
"Return the normal pdf evaluated at *x*; args provides *mu*, *sigma*"

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@
233233
from matplotlib.mlab import (
234234
amap, base_repr, binary_repr, bivariate_normal, center_matrix, csv2rec,
235235
demean, detrend, detrend_linear, detrend_mean, detrend_none, dist,
236-
dist_point_to_segment, distances_along_curve, entropy, exp_safe,
236+
dist_point_to_segment, distances_along_curve, exp_safe,
237237
fftsurr, find, frange, get_sparse_matrix, get_xyz_where, griddata,
238238
identity, inside_poly, is_closed_polygon, ispower2, isvector, l1norm,
239239
l2norm, log2, longest_contiguous_ones, longest_ones, movavg, norm_flat,

0 commit comments

Comments
 (0)