I have a 2D Numpy array of tile objects that serves as a map. The outer ring is all "wall" values to make a closed border. I want to make a copy of the inner values to iterate over without touching the outer rows and columns. I'm trying:
inner_values = map.tiles[1:-1][1:-1]
to cut off the top and bottom rows and left and right columns. My map is 100*70, and this keeps giving me an array of shape (96, 70) when I want (98, 68). How can I use slices correctly to get my inner values? Thanks!
map.tiles[1:-1]. The net slice is[2:-2]. Not what you want.mapas variable name. This is a (very useful) python builtin.