0

I have come across this code and I have seen this unusual operation:

return Xtrain @ eigenvectors[:2]

Does anyone know what it does?

khelwood
  • 55,782
  • 14
  • 81
  • 108
Kajal_T
  • 65
  • 8
  • 1
    TL;DR - matrix multiplication – CDJB Dec 09 '19 at 16:55
  • 2
    Does this answer your question? [What does the "at" (@) symbol do in Python?](https://stackoverflow.com/questions/6392739/what-does-the-at-symbol-do-in-python) Note, that your case is *not* in the accepted answer, but in one of the others. It is an overloaded operator. – Eugene Sh. Dec 09 '19 at 16:55

1 Answers1

1

Python documentation says:

Matrix Multiplication

Operator

a @ b

Function

matmul(a, b)
khelwood
  • 55,782
  • 14
  • 81
  • 108
Vlad DX
  • 4,200
  • 19
  • 28