yu = np.array([np.nan, np.nan, np.nan, np.nan, np.nan,])
rte = np.array([1,2,3,4,5])
yu[0] = rte[0]
yu # array([ 1., nan, nan, nan, nan])
yet..
[yu[i] = rte[i] for i in range(len(rte))]
SyntaxError: invalid syntax
Specifically, I'm trying to fill the nan in an array with other array of same length:
[pred[first_c_rowNA, 0::][0::, wNA[0]][i] = output[i] for i in np.arange(len(output))]
SyntaxError: invalid syntax
pred[first_c_rowNA, 0::][0::, wNA[0]] # array([ nan, nan, nan, ..., nan, nan, nan])
and
output # array([ 0., 0., 0., ..., 0., 0., 0.]) # not all are zeros
Thanks