ipythonblocks icon indicating copy to clipboard operation
ipythonblocks copied to clipboard

confusing indexing

Open lepmik opened this issue 7 years ago • 1 comments

Hi!

First of all, love this project! Using it to teach matrix indexing, and finally simulate and animate an epidemic.

One thing I find a bit confusing though is your choice of indexing which is different from numpy e.g.

grid = BlockGrid(20, 10, block_size=4)
print(grid.shape)
>>> (20, 10)
grid[9, 19]

As opposed to numpy

grid = np.zeros((20,10))
print(grid.shape)
>>> (20, 10)
grid[19, 9]

lepmik avatar Oct 18 '18 11:10 lepmik

To clarify, it's the shape output I'm confused about, i.e. that grid.shape[0] is the number of columns

lepmik avatar Oct 18 '18 11:10 lepmik