Skip to content

Commit 4bbc38f

Browse files
authored
fix #812 : Array.reindex does not longer print a spurious warning message when the axes_to_reindex argument is the name of the axis to reindex
1 parent 5ab8316 commit 4bbc38f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

doc/source/changes/version_0_32.rst.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ Fixes
5555
^^^^^
5656

5757
* fixed binary operations between a session and an array object (closes :issue:`807`).
58+
59+
* fixed the :py:obj:`Array.reindex()` printing a spurious warning message when the
60+
`axes_to_reindex` argument is the name of the axis to reindex (closes :issue:`812`)

larray/core/array.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,11 +1595,8 @@ def reindex(self, axes_to_reindex=None, new_axis=None, fill_value=nan, inplace=F
15951595
a1 c0 2 1
15961596
"""
15971597
# XXX: can't we move this to AxisCollection.replace?
1598-
if isinstance(axes_to_reindex, basestring):
1599-
try:
1600-
axes_to_reindex = Axis(axes_to_reindex)
1601-
except:
1602-
pass
1598+
if isinstance(axes_to_reindex, basestring) and '=' in axes_to_reindex:
1599+
axes_to_reindex = Axis(axes_to_reindex)
16031600
if isinstance(axes_to_reindex, (Group, Axis)) and not isinstance(axes_to_reindex, AxisReference):
16041601
new_axis = axes_to_reindex if isinstance(axes_to_reindex, Axis) else Axis(axes_to_reindex)
16051602
axes_to_reindex = self.axes[new_axis]

0 commit comments

Comments
 (0)