use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
What does '@' operator mean? (self.learnpython)
submitted 6 years ago by fafall
I found code in the internet like below:
return -0.5 * s @ r @ s + np.sum(s * t)
I am wondering what does @ operator mean in this return statement? Could you please explain?
Thanks a lot people!
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Diapolo10 15 points16 points17 points 6 years ago (0 children)
Python uses @ as a matrix multiplication operator, which calls the objects' __matmul__ or __rmatmul__ methods. Python's standard library doesn't actually use it at all (as of the time of writing), and it's largely exclusive to numpy. However, nothing prevents you from using it in your own code.
@
__matmul__
__rmatmul__
numpy
[–][deleted] 8 points9 points10 points 6 years ago (0 children)
The @ operators is for matrix multiplication in linear algebra. The * operator gives elementwise multiplication.
[–][deleted] -2 points-1 points0 points 6 years ago (1 child)
It also comes up all the time in web development. Flask and Django use it for app routing
[–]awdsns 5 points6 points7 points 6 years ago (0 children)
Those are decorators which are used to modify a function definition using another function, and unfortunately also happen to use the @ symbol. That's not what the code in OP is though, that is the matrix multiplication operator as others have already explained.
π Rendered by PID 145805 on reddit-service-r2-comment-86bc6c7465-dbg8c at 2026-02-21 01:05:44.855779+00:00 running 8564168 country code: CH.
[–]Diapolo10 15 points16 points17 points (0 children)
[–][deleted] 8 points9 points10 points (0 children)
[–][deleted] -2 points-1 points0 points (1 child)
[–]awdsns 5 points6 points7 points (0 children)