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

Skip to content

Commit 6de5073

Browse files
committed
Remove mlab.recs_join
1 parent b542961 commit 6de5073

2 files changed

Lines changed: 1 addition & 59 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
@@ -41,6 +41,7 @@ in Matplotlib 2.2 has been removed. See below for a list:
4141
- `mlab.inside_poly`
4242
- `mlab.rec2csv` (use numpy.recarray.tofile instead)
4343
- `mlab.rec2text` (use numpy.recarray.tofile instead)
44+
- `mlab.recs_join`
4445
- `mlab.csvformat_factory`
4546
- `mlab.get_formatd`
4647
- `mlab.FormatDatetime` (use datetime.strftime instead)

lib/matplotlib/mlab.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,65 +1821,6 @@ def mapped_r2field(name):
18211821
return newrec
18221822

18231823

1824-
@cbook.deprecated("2.2")
1825-
def recs_join(key, name, recs, jointype='outer', missing=0., postfixes=None):
1826-
"""
1827-
Join a sequence of record arrays on single column key.
1828-
1829-
This function only joins a single column of the multiple record arrays
1830-
1831-
*key*
1832-
is the column name that acts as a key
1833-
1834-
*name*
1835-
is the name of the column that we want to join
1836-
1837-
*recs*
1838-
is a list of record arrays to join
1839-
1840-
*jointype*
1841-
is a string 'inner' or 'outer'
1842-
1843-
*missing*
1844-
is what any missing field is replaced by
1845-
1846-
*postfixes*
1847-
if not None, a len recs sequence of postfixes
1848-
1849-
returns a record array with columns [rowkey, name0, name1, ... namen-1].
1850-
or if postfixes [PF0, PF1, ..., PFN-1] are supplied,
1851-
[rowkey, namePF0, namePF1, ... namePFN-1].
1852-
1853-
Example::
1854-
1855-
r = recs_join("date", "close", recs=[r0, r1], missing=0.)
1856-
1857-
"""
1858-
results = []
1859-
aligned_iters = cbook.align_iterators(operator.attrgetter(key),
1860-
*[iter(r) for r in recs])
1861-
1862-
def extract(r):
1863-
if r is None:
1864-
return missing
1865-
else:
1866-
return r[name]
1867-
1868-
if jointype == "outer":
1869-
for rowkey, row in aligned_iters:
1870-
results.append([rowkey] + list(map(extract, row)))
1871-
elif jointype == "inner":
1872-
for rowkey, row in aligned_iters:
1873-
if None not in row: # throw out any Nones
1874-
results.append([rowkey] + list(map(extract, row)))
1875-
1876-
if postfixes is None:
1877-
postfixes = ['%d' % i for i in range(len(recs))]
1878-
names = ",".join([key] + ["%s%s" % (name, postfix)
1879-
for postfix in postfixes])
1880-
return np.rec.fromrecords(results, names=names)
1881-
1882-
18831824
@cbook.deprecated("2.2")
18841825
def csv2rec(fname, comments='#', skiprows=0, checkrows=0, delimiter=',',
18851826
converterd=None, names=None, missing='', missingd=None,

0 commit comments

Comments
 (0)