Skip to content

How to sum an Array or ArraySymbol over an axis? #22269

Answered by Upabjojr
redeboer asked this question in Q&A
Discussion options

You must be logged in to vote

It seems that it is not yet possible to perform computations on the axes of (symbolic) arrays. This would be required for creating expressions that can be lambdified to numpy.sum(..., axis=1).

ArrayContraction can be given single axes:

ArrayContraction(..., (1,))

This is equivalent to numpy.sum(..., axis=1)

Replies: 4 comments 26 replies

Comment options

You must be logged in to vote
12 replies
@ThePauliPrinciple
Comment options

@redeboer
Comment options

@redeboer
Comment options

@oscarbenjamin
Comment options

@ThePauliPrinciple
Comment options

Comment options

You must be logged in to vote
6 replies
@redeboer
Comment options

@ThePauliPrinciple
Comment options

@Upabjojr
Comment options

@Upabjojr
Comment options

@Upabjojr
Comment options

Comment options

You must be logged in to vote
8 replies
@Upabjojr
Comment options

@ThePauliPrinciple
Comment options

@Upabjojr
Comment options

@ThePauliPrinciple
Comment options

@Upabjojr
Comment options

Answer selected by redeboer
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants