I am trying to add a list of monthly temperatures into a big list that will contain 24 months of temperatures. The problem is that they are given in floats, but to append items, they must be integers.
temperatures = 
np.array(temperatures, dtype = np.float32)
for item in TEMP1:
File "/home/piscopo/Bureau/EC/Alert_extraction.py", line 87, in <module>
TypeError: list indices must be integers, not numpy.float32
You have to save your nparray in a variable and then you can add your TEMP1 monthly temperatures all at once with the method append() like this :
import numpy as np TEMP1 = [22.4, 14.4, 12.3] temperatures =  floatTemperatures = np.array(temperatures, dtype = np.float32) floatTemperatures = np.append(floatTemperatures, TEMP1)