Skip to content

Instantly share code, notes, and snippets.

@karamanbk
Created June 9, 2019 08:23
Show Gist options
  • Save karamanbk/fae78e4b0894cc0812812e4e600e5860 to your computer and use it in GitHub Desktop.
Save karamanbk/fae78e4b0894cc0812812e4e600e5860 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@marsilinou97
Copy link

marsilinou97 commented May 10, 2021

Good day!

I am getting error on indent 41
print np.concatenate([y_pred[index],X_test[index]],axis=1)
^
SyntaxError: invalid syntax

In [41]:

#rebuild test set for inverse transform
pred_test_set = []
for index in range(0,len(y_pred)):
print np.concatenate([y_pred[index],X_test[index]],axis=1)
pred_test_set.append(np.concatenate([y_pred[index],X_test[index]],axis=1))

Please tell me the solution.

Thank you

This is running version 2.X of python, while you're running python 3.X, just add () for the print print(np.concatenate([y_pred[index],X_test[index]],axis=1))

@Shamanbazooka
Copy link

Добрый день!
Я получаю ошибку при
отступе 41 print np.concatenate ([y_pred [index], X_test [index]], axis = 1)
^
SyntaxError: недопустимый синтаксис
В [41]:
#rebuild набор тестов для обратного преобразования
pred_test_set = []
для индекса в диапазоне (0, len (y_pred)):
print np.concatenate ([y_pred [index], X_test [index]], axis = 1)
pred_test_set.append (np .concatenate ([y_pred [индекс], X_test [индекс]], ось = 1))
Подскажите пожалуйста решение.
Спасибо

Это работает под управлением Python версии 2.X, в то время как вы используете Python 3.X, просто добавьте () для печати print(np.concatenate([y_pred[index],X_test[index]],axis=1))

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment