1
for i in range(60,1259):
    X_train.append(training_scaled[i-60:i, 0])
    y_train.append(training_scaled[i,0])
x_train,y_train = np.array(X_train),np.array(y_train)

Error 'numpy.ndarray' object has no attribute 'append'

5
  • 1
    Remove the .np. X_train.append Commented Sep 12, 2022 at 7:42
  • Still the error remains Commented Sep 12, 2022 at 7:45
  • Than you have it in other places as well. Use np only when you want to access something directly from numpy. Commented Sep 12, 2022 at 7:48
  • I Have altered my code in my post can you recheck with the new error which is popping out Commented Sep 12, 2022 at 7:49
  • stackoverflow.com/questions/8409498/… Commented Sep 12, 2022 at 7:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.