Skip to content

API: Support Matrix Multiplication Ops (@) #10259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sinhrks opened this issue Jun 3, 2015 · 7 comments
Closed

API: Support Matrix Multiplication Ops (@) #10259

sinhrks opened this issue Jun 3, 2015 · 7 comments
Labels
Compat pandas objects compatability with Numpy or Python functions Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Jun 3, 2015

Python 3.5 is being released on Sep.13. Maybe we can wait for v0.17?

@sinhrks sinhrks added this to the 0.17.0 milestone Jun 3, 2015
@jreback
Copy link
Contributor

jreback commented Jun 3, 2015

we need Travis to support 3.5 before can do this
iirc for 3.4 this support took some time

@shoyer
Copy link
Member

shoyer commented Jun 3, 2015

We can certainly test @ by calling __matmul__ explicitly.

But we certainly should wait until numpy 1.10 is out -- until then we don't even have a np.matmul implementation to use internally.

@charris
Copy link

charris commented Jun 5, 2015

Note that the current numpy implementation does not support object arrays.

@jreback jreback modified the milestones: Next Major Release, 0.17.0 Aug 15, 2015
@shoyer shoyer added Numeric Operations Arithmetic, Comparison, and Logical operations Compat pandas objects compatability with Numpy or Python functions Python 3.5 and removed API Design labels Sep 15, 2015
@bnaul
Copy link
Contributor

bnaul commented Dec 13, 2017

I was a bit surprised to find that this isn't already supported since I've gotten so used to @ in numpy. This case seems a bit simpler since there's no analog of scalars; does that mean that just setting __matmul__ = dot is sufficient or am I missing some other subtlety?

@shoyer
Copy link
Member

shoyer commented Dec 13, 2017

does that mean that just setting matmul = dot is sufficient or am I missing some other subtlety?

There is a small amount of subtlety in returning NotImplemented when the other argument is the wrong type (standard for binary operators), but yes this should be pretty straightforward.

@charris
Copy link

charris commented Dec 13, 2017

Note that @ and dot broadcast differently. I don't know if that means anything for pandas ...

@shoyer
Copy link
Member

shoyer commented Dec 13, 2017

In pandas we only have 1D and 2D data structures (ignoring Panel, which is deprecated), so the broadcasting behavior is irrelevant.

@jreback jreback modified the milestones: Next Major Release, 0.23.0 Feb 20, 2018
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.23.0, Next Major Release Mar 29, 2018
@jreback jreback modified the milestones: Next Major Release, 0.23.0 Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

No branches or pull requests

6 participants