Advertisement
z_californianus

Untitled

Apr 7th, 2020
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. import numpy as np
  2. spot_matrix = np.array([
  3.    [10, 11, 12, 13, 14, 15],
  4.    [11, 12, 13, 14, 15, 16],
  5.    [12, 13, 14, 15, 16, 17],
  6.    [13, 14, 15, 16, 17, 18],
  7.    [14, 15, 16, 17, 18, 19],
  8.    [15, 16, 17, 18, 19, 20]
  9. ])
  10.  
  11. spot_counts = {}
  12. for i in range(0, 6):
  13.     for j in range(0, 6):
  14.         if spot_matrix[i][j] not in spot_counts.keys():
  15.             spot_counts[spot_matrix[i][j]] = 1
  16.         else:
  17.             spot_counts[spot_matrix[i][j]] += 1
  18.  
  19. spot_probs = {k: spot_counts[k]/36 for k in spot_counts}
  20. print(spot_probs.values())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement