print(lw)
array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 
    0, 1, 0, 2, 0, 0, 0, 3, 0], [0, 0, 0, 0, 0, 0, 4, 0, 3, 0], [0, 0, 0, 0,
    0, 0, 4, 0, 0, 0], [0, 0, 0, 0, 5, 0, 4, 0, 0, 0], [0, 0, 0, 0, 0, 4, 4,
    0, 0, 0], [0, 0, 0, 6, 0, 4, 0, 0, 0, 0], [0, 0, 0, 0, 7, 0, 0, 0, 0, 0
    ], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
How to find cluster sizes in 2D numpy array?