From e6b8e75547af0cc4d38af458eff5e5d6c14102b8 Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Wed, 22 Mar 2017 23:10:43 +0000 Subject: MAINT: Remove code duplicated from np.r_ in np.ma.mr_ Also adds a test for the disabled-by-design behaviour - this would return raw matrices, not masked arrays --- numpy/lib/index_tricks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/lib/index_tricks.py') diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py index 1fd530f33..58d3e0dcf 100644 --- a/numpy/lib/index_tricks.py +++ b/numpy/lib/index_tricks.py @@ -237,6 +237,8 @@ class AxisConcatenator(object): For detailed documentation on usage, see `r_`. """ + # allow ma.mr_ to override this + concatenate = staticmethod(_nx.concatenate) def _retval(self, res): if self.matrix: @@ -345,7 +347,7 @@ class AxisConcatenator(object): for k in scalars: objs[k] = objs[k].astype(final_dtype) - res = _nx.concatenate(tuple(objs), axis=self.axis) + res = self.concatenate(tuple(objs), axis=self.axis) return self._retval(res) def __len__(self): -- cgit v1.2.1