[AstroPy] Summing an array

Rudolf Baer rbaer25 at gmail.com
Mon Jul 11 09:03:42 EDT 2022


I have not been able to sum an array; the array is created as follows

rpflux = np.array(rpflux, dtype=float)
rpflux=np.zeros(len(rptime),dtype='float64')
rpflux=np.genfromtxt(path,delimiter=',',dtype="float64",autostrip=True,skip_header=137,skip_footer=0,
usecols=(19))
print(rpflux.astype('float64'))

[3140.           nan 2770.     3080.     3170.     3050.     3060.
 3100.     2990.     3120.     3060.           nan 3100.     3070.
 3020.           nan 3200.     3150.     3350.     2990.     2910.
 2920.     3030.     3000.     2800.     2980.     2860.     2840.
 2610.     2650.     2610.     2650.     2490.     2490.     2540.
 2510.     2470.           nan       nan   35.           nan 3099.
       nan ]


print (np.sum(rpflux))
and
print (np.sum([rpflux]))
result in
'numpy.ndarray' object is not callable'

I have tried several alternatives, none of them work. Any suggestions
would be appreciated.
Rudolf Baer

Mac Os 10.15.6, python 3.7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20220711/cb7011c1/attachment.html>


More information about the AstroPy mailing list