I have the array vAgarch
and I am trying to extract each element from that, so I have the following code now:
vAgarch = [0.05, 0.03, 0.04, 0.05, 0.03, 0.04]
vAgarch = np.array(vAgarch)
# Extract each element from array vAgarch
dA1garch = np.fabs(vAgarch[0])
dA2garch = np.fabs(vAgarch[1])
dA3garch = np.fabs(vAgarch[2])
dA4garch = np.fabs(vAgarch[3])
dA5garch = np.fabs(vAgarch[4])
dA6garch = np.fabs(vAgarch[5])
However, this could be easier right? My array will consist of 40 elements later on and I think this code can be simplified with a for loop. I tried several for loops, but so far I have no success. Is there someone who can help me with simplifying this code?