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

API: Support Matrix Multiplication Ops (@) #10259

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

Comments

Projects
None yet
6 participants
@sinhrks
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 the API Design label Jun 3, 2015

@sinhrks sinhrks added this to the 0.17.0 milestone Jun 3, 2015

@jreback

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

@bnaul

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

charris commented Dec 13, 2017

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

@shoyer

This comment has been minimized.

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