Skip to content

Commit

Permalink
MAINT: Replace np.int (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Jan 12, 2022
1 parent 5b29877 commit 1eabdbf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def _populate_blotto_payoff_arrays(payoff_arrays, actions, values):
for p in range(2):
payoffs[p] += values[k, p] / 2
else:
winner = np.int(actions[i, k] < actions[j, k])
winner = np.intp(actions[i, k] < actions[j, k])
payoffs[winner] += values[k, winner]
payoff_arrays[0][i, j], payoff_arrays[1][j, i] = payoffs

Expand Down
2 changes: 1 addition & 1 deletion quantecon/random/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _sample_without_replacement(n, r, out):
# Logic taken from random.sample in the standard library
pool = np.arange(n)
for j in range(k):
idx = int(np.floor(r[j] * (n-j))) # np.floor returns a float
idx = np.intp(np.floor(r[j] * (n-j))) # np.floor returns a float
out[j] = pool[idx]
pool[idx] = pool[n-j-1]

Expand Down
2 changes: 1 addition & 1 deletion quantecon/util/tests/test_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_comb_zeros(self):

eq_(comb_jit(self.MAX_INTP, 2), 0)

N = np.int(self.MAX_INTP**0.5 * 2**0.5) + 1
N = np.intp(self.MAX_INTP**0.5 * 2**0.5) + 1
eq_(comb_jit(N, 2), 0)

def test_max_intp(self):
Expand Down

0 comments on commit 1eabdbf

Please sign in to comment.