I want to create a Numpy array, which contains two (Python-) lists. When i try to append an element to one of those lists, the code crashes.
import numpy as np
list0 = [0,0,0]
list1 = [1,1,1]
#list1.append(0)
print(type(list0))
print(type(list1))
array0 = np.array((list0, list1))
array0[0].append(42)
print(array0)
The confusing thing is that when i uncomment the 4th line, the code works just fine.
The error message i get:
File "test.py", line 10, in <module>
array0[0].append(3)
AttributeError: 'numpy.ndarray' object has no attribute 'append'
I run on python 3.5.1 and numpy 1.10.4