Python Counting Elements In 2d