This is my current code:
import numpy as np
vec0 = [1, 2, 3]
vec1 = [2, 3, 4]
vec2 = [3, 4, 5]
vec3 = [4, 5, 6]
for k in range(0, 4):
globals()['mean%s' % k] = np.mean('vec'+str(k))
I'm getting this error:
TypeError: cannot perform reduce with flexible type
I want to this result.
mean0 = np.mean(vec0)
mean1 = np.mean(vec1)
mean2 = np.mean(vec2)
mean3 = np.mean(vec3)