3 ms·
> You arrive at the problem of then not having an element- > wise version of the multiplication but it's not as if this > solves that problem anyway. Pleas
by apl 13y ago
> You arrive at the problem of then not having an element-
> wise version of the multiplication but it's not as if this
> solves that problem anyway.
Please reread the text. It's exactly what it does, and an exhaustive rationale is given for why both operators are useful and necessary.
# Matrix multiplication:
a = b @ c
# Element-wise multiplication:
a = b * c
- NamTaf 13y agoMy apologies, I misremembered that from when I first read it. I'm still on python 2.7 - in 3, does: [3] * [5] = [15] ? Because really it needs to reduce down to that if it's going to make sense from a continuity point of view. edit: To clarify: Is that already part of 3.x, or shall it become part of 3.x once this is implemented?
- apl 13y agoA Python list is not a matrix, so I don't see how this change would entail your statement. Of course, for very specific use cases, a list looks like a numerical vector; the semantics are very different, though.
- maxerickson 13y agoFor numpy arrays, yes (for pretty much all versions). As apl said, Python lists aren't strictly a numerical type. "Numerical type" isn't quite the right description either, but the underlying point is that the design choices for lists don't necessarily favor mathematical convenience or consistency.
- rplnt 13y agoWhat about * *? Would that be confusing? edit: Why not ×? It's unicode source afterall...
- untothebreach 13y agothis is covered in the linked document: Symbols which are not present on US English keyboards start at a significant disadvantage
- rplnt 13y agoAh, thank you. To be honest, I haven't read anything past the paragraph about it being niche.
- jzwinck 13y ago← APL is that way.