Skip to content

Commit

Permalink
clean up _AXIS_NAMES
Browse files Browse the repository at this point in the history
  • Loading branch information
topper-123 committed Apr 18, 2020
1 parent ab8ed31 commit 39ba455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,7 @@ def _create_axes(
# Now we can construct our new index axis
idx = axes[0]
a = obj.axes[idx]
axis_name = obj._AXIS_NAMES[idx]
axis_name = obj._get_axis_name(idx)
new_index = _convert_index(axis_name, a, self.encoding, self.errors)
new_index.axis = idx

Expand Down Expand Up @@ -3919,7 +3919,7 @@ def process_axes(self, obj, selection: "Selection", columns=None):

def process_filter(field, filt):

for axis_name in obj._AXIS_NAMES.values():
for axis_name in obj._AXIS_ORDERS:
axis_number = obj._get_axis_number(axis_name)
axis_values = obj._get_axis(axis_name)
assert axis_number is not None
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/generic/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def test_rename(self):
def test_get_numeric_data(self):

n = 4
kwargs = {self._typ._AXIS_NAMES[i]: list(range(n)) for i in range(self._ndim)}
kwargs = {
self._typ._get_axis_name(i): list(range(n)) for i in range(self._ndim)
}

# get the numeric data
o = self._construct(n, **kwargs)
Expand Down

0 comments on commit 39ba455

Please sign in to comment.