list - For loop python invalid syntax -
i'm trying run loop in program calculate average of h need calculate value's of 2 arrays each element of arrays , add them up.
htot = 0 in range (0, len(redshift)): h = ((300000*redshift[i])/(np.power(10, (appmag[i]-19.0+5)/5)) htot = htot + h hgem = htot/len(redshift) print htot
but invalid syntax error @ htot = htot + h
you forgot close parenthesis on previous line.
there many anyway, these enough:
h = 300000 * redshift[i] / np.power(10, (appmag[i] - 19.0 + 5) / 5)
Comments
Post a Comment