I want to append two lists A[0]
and A
but I am getting an error. I present the expected output.
import numpy as np
A=[]
A[0]=[np.array([[0.4]])]
A=[np.array([[0.15]])]
print("A =",A)
The error is
in <module>
A[0]=[np.array([[0.4]])]
IndexError: list assignment index out of range
The expected output is
[array([[0.4]]),
array([[0.15]])]