Skip to content

Commit

Permalink
try int_ instead of intp
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Sep 16, 2024
1 parent e7c603b commit 722dfc7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flox/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ def groupby_reduce(
)

is_bool_array = np.issubdtype(array.dtype, bool)
array = array.astype(np.intp) if is_bool_array else array
array = array.astype(np.int_) if is_bool_array else array

isbins = _atleast_1d(isbin, nby)

Expand Down
4 changes: 2 additions & 2 deletions flox/xrdtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ def _maybe_promote_int(dtype) -> np.dtype:
if not isinstance(dtype, np.dtype):
dtype = np.dtype(dtype)
if dtype.kind == "i":
dtype = np.result_type(dtype, np.intp)
dtype = np.result_type(dtype, np.int_)
elif dtype.kind == "u":
dtype = np.result_type(dtype, np.uintp)
dtype = np.result_type(dtype, np.uint_)
return dtype


Expand Down

0 comments on commit 722dfc7

Please sign in to comment.