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

Skip to content

Commit ac0fc08

Browse files
committed
Remove mlab.rec_append_fields
1 parent afcb2b6 commit ac0fc08

3 files changed

Lines changed: 2 additions & 36 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
@@ -47,6 +47,7 @@ in Matplotlib 2.2 has been removed. See below for a list:
4747
- `mlab.rec_groupby`
4848
- `mlab.rec_keep_fields`
4949
- `mlab.rec_drop_fields`
50+
- `mlab.rec_append_fields`
5051
- `mlab.csvformat_factory`
5152
- `mlab.get_formatd`
5253
- `mlab.FormatDatetime` (use datetime.strftime instead)

lib/matplotlib/mlab.py

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,41 +1543,6 @@ def safe_isinf(x):
15431543
return b
15441544

15451545

1546-
@cbook.deprecated("2.2")
1547-
def rec_append_fields(rec, names, arrs, dtypes=None):
1548-
"""
1549-
Return a new record array with field names populated with data
1550-
from arrays in *arrs*. If appending a single field, then *names*,
1551-
*arrs* and *dtypes* do not have to be lists. They can just be the
1552-
values themselves.
1553-
"""
1554-
if (not isinstance(names, str) and np.iterable(names)
1555-
and len(names) and isinstance(names[0], str)):
1556-
if len(names) != len(arrs):
1557-
raise ValueError("number of arrays do not match number of names")
1558-
else: # we have only 1 name and 1 array
1559-
names = [names]
1560-
arrs = [arrs]
1561-
arrs = list(map(np.asarray, arrs))
1562-
if dtypes is None:
1563-
dtypes = [a.dtype for a in arrs]
1564-
elif not np.iterable(dtypes):
1565-
dtypes = [dtypes]
1566-
if len(arrs) != len(dtypes):
1567-
if len(dtypes) == 1:
1568-
dtypes = dtypes * len(arrs)
1569-
else:
1570-
raise ValueError("dtypes must be None, a single dtype or a list")
1571-
old_dtypes = rec.dtype.descr
1572-
newdtype = np.dtype(old_dtypes + list(zip(names, dtypes)))
1573-
newrec = np.recarray(rec.shape, dtype=newdtype)
1574-
for field in rec.dtype.fields:
1575-
newrec[field] = rec[field]
1576-
for name, arr in zip(names, arrs):
1577-
newrec[name] = arr
1578-
return newrec
1579-
1580-
15811546
@cbook.deprecated("2.2")
15821547
def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',',
15831548
converterd=None, names=None, missing='', missingd=None,

lib/matplotlib/pylab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
frange,
236236
identity, ispower2, isvector, l1norm,
237237
l2norm, log2, movavg, norm_flat,
238-
rec_append_fields, rms_flat,
238+
rms_flat,
239239
window_hanning, window_none)
240240

241241
from matplotlib import cbook, mlab, pyplot as plt

0 commit comments

Comments
 (0)