Skip to content

Commit

Permalink
use np.generic
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzamora committed Jan 9, 2025
1 parent e75a9bf commit 20ab966
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dask/dataframe/dask_expr/_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def __getitem__(self, other):
other = list(other)
elif isinstance(other, list):
other = other.copy()
elif is_scalar(other) and hasattr(other, "item"):
elif isinstance(other, np.generic):
other = other.item()
return new_collection(self.expr.__getitem__(other))

Expand Down
2 changes: 1 addition & 1 deletion dask/dataframe/dask_expr/_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __getitem__(self, key):
iindexer = key
cindexer = None

if is_scalar(cindexer) and hasattr(cindexer, "item"):
if isinstance(cindexer, np.generic):
cindexer = cindexer.item()

return self._loc(iindexer, cindexer)
Expand Down

0 comments on commit 20ab966

Please sign in to comment.