8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3b2242 commit d561031Copy full SHA for d561031
larray/core/axis.py
@@ -1811,8 +1811,12 @@ def __str__(self):
1811
return "{%s}" % ', '.join(self.display_names)
1812
1813
def __repr__(self):
1814
- axes_repr = (repr(axis) for axis in self._list)
1815
- return "AxisCollection([\n %s\n])" % ',\n '.join(axes_repr)
+ if len(self):
+ repr_per_axis = [repr(axis) for axis in self._list]
1816
+ axes_repr = "\n {}\n".format(',\n '.join(repr_per_axis))
1817
+ else:
1818
+ axes_repr = ""
1819
+ return "AxisCollection([{}])".format(axes_repr)
1820
1821
# TODO: kill name argument (does not seem to be used anywhere
1822
def get(self, key, default=None, name=None):
0 commit comments