I have a 2-dimensional array with each element being a list of valid values (pseudosyntax):
[ [1,2] [1,2]
[1,2] [1,2] ]
so effectively it's a 3-dim array/list/matrix (whatever Python calls those.)
It is generated by
import numpy as np
grid = np.full((borderSize, borderSize, borderSize), range(1, borderSize + 1))
What is the best practice to remove a value from an array on the "deepest" level?
Pseudocode:
grid = [ [1,2] [1,2]
[1,2] [1,2] ]
grid[0,1].remove(not index but value 2)
#result: grid = [ [1,2] [1]
[1,2] [1,2] ]
I did attempt every solution I could google, including numpy.delete() and array.remove(), any whatever that syntax is: arr = arr[ (arr >= 6) & (arr <= 10) ]. All the approaches seem to "flatten" the array/list/matrix, or throw cryptic-to-me errors ("can't broadcast array into shape")
Thanks!