@@ -36,7 +36,7 @@ def run():
3636 digits_file = (Path (__file__ ).resolve ().parent
3737 / "datasets" / "digits" / "digits.csv" )
3838 digits_knn = KNN (Digit , digits_file , has_header = False )
39- # Startup Pygame, create the window
39+ # Start up Pygame, create the window
4040 pygame .init ()
4141 screen = pygame .display .set_mode (size = (PIXEL_WIDTH , PIXEL_HEIGHT ),
4242 flags = pygame .SCALED | pygame .RESIZABLE )
@@ -59,7 +59,8 @@ def run():
5959 pixels = digit_pixels .transpose ((1 , 0 , 2 ))[:, :, 0 ].flatten () * P_TO_D
6060 predicted_pixels = digits_knn .predict_array (K , Digit ("" , pixels ), "pixels" )
6161 predicted_pixels = predicted_pixels .reshape ((PIXEL_HEIGHT , PIXEL_WIDTH )).transpose ((1 , 0 )) * D_TO_P
62- digit_pixels = np .stack ((predicted_pixels , predicted_pixels , predicted_pixels ), axis = 2 )
62+ digit_pixels = np .stack ((predicted_pixels , predicted_pixels ,
63+ predicted_pixels ), axis = 2 )
6364 # Handle mouse events
6465 elif ((event .type == pygame .MOUSEBUTTONDOWN ) or
6566 (event .type == pygame .MOUSEMOTION and pygame .mouse .get_pressed ()[0 ])):
0 commit comments