From 7b3ca4c628cf357e08c4d1ee0484f17f8ebcc07d Mon Sep 17 00:00:00 2001 From: wvul Date: Wed, 7 Aug 2024 11:15:33 -0700 Subject: [PATCH] Update car_rental.py to use np.int32 instead of np.int np.int has been deprecated as an alias for the builtin int. int32 is sufficient for the policies. --- chapter04/car_rental.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapter04/car_rental.py b/chapter04/car_rental.py index 00738572..fea5bcc4 100644 --- a/chapter04/car_rental.py +++ b/chapter04/car_rental.py @@ -123,7 +123,7 @@ def expected_return(state, action, state_value, constant_returned_cars): def figure_4_2(constant_returned_cars=True): value = np.zeros((MAX_CARS + 1, MAX_CARS + 1)) - policy = np.zeros(value.shape, dtype=np.int) + policy = np.zeros(value.shape, dtype=np.int32) iterations = 0 _, axes = plt.subplots(2, 3, figsize=(40, 20))