Im not sure if im missing something out because i'm new to Python, but according to a few threads and docs that I've read like this one, from what i understand the numpy should change the array since im passing it by parameter. Thats not what is occurring in my code though.
class Graph(object):
def __init__(self):
self.arr = self.createArray()
def insertVertice(self):
##SHAPE = (1,1) - (2,2)
np.insert(self.arr, 0, 0, axis=1)
if I let the code like this and print "arr", the bidimensional array stays the same [[0 0] [0 0]] but if I do it like:
self.arr = np.insert(self.arr, 0, 0, axis=1)
It changes...[[0 0 0] [0 0 0]]
Does anyone have a clue on what am I missing here?
Note that insert does not occur in-place: a new array is returned.returnstatement best practices, maybe you'll find more information and learn what was missing here !