Iterating through a multidimensional array in Python

前端 未结 7 1498
旧巷少年郎
旧巷少年郎 2020-12-13 13:35

I have created a multidimensional array in Python like this:

self.cells = np.empty((r,c),dtype=np.object)

Now I want to iterate through all

相关标签:
7条回答
  • 2020-12-13 14:15

    How about this:

    import itertools
    for cell in itertools.chain(*self.cells):
        cell.drawCell(surface, posx, posy)
    
    0 讨论(0)
提交回复
热议问题