0
I have tried everything and could not add the number 1 at the bottom of the list predictors. Gives the following error:
new_inputs[i] = np.append(inputs[i],one[i])
Indexerror: list assignment index out of range
I can’t use append normal because it is an array and using the library Numpy also does not work. I need to put the value 1 in the last column of each sample.
That is the code:
base = pd.read_excel("TSLA.xlsx", sheet_name=4)
base = base.dropna()
base_treinamento = base.iloc[:, 1:2].values
previsores = []
preco_real = []
for i in range(90, 753):
previsores.append(base_treinamento[i-90:i, 0])
preco_real.append(base_treinamento[i, 0])
inputs = np.array(previsores)
one =np.ones(len(previsores))
new_inputs=[]
for i in range(len(previsores)):
new_inputs[i] = np.append(inputs[i], one[i] )
And the link to the file: TSLA
It worked perfect, thanks!
– Victor