Skip to content

Commit

Permalink
remove len condition
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Oct 24, 2023
1 parent 90cdb2f commit 4a0792d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions anndata/_core/anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 +875,9 @@ def _prep_dim_index(self, value, attr: str) -> pd.Index:
value = pd.Index(value)
if not isinstance(value.name, (str, type(None))):
value.name = None
if (
len(value) > 0
and not isinstance(value, pd.RangeIndex)
and infer_dtype(value) not in ("string", "bytes")
if not (
isinstance(value, pd.RangeIndex)
or infer_dtype(value) in ("string", "bytes")
):
sample = list(value[: min(len(value), 5)])
msg = dedent(
Expand Down

0 comments on commit 4a0792d

Please sign in to comment.