You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The negative indexing for sympy.Array seems to be broken.
In [1]: import numpy as np
...: import sympy as sp
...:
...: a = np.array([[1,2],[3,4]])
...: b = sp.Array(a)
...: c = sp.Matrix(a)
In [2]: a[:,-1]
Out[2]: array([2, 4])
In [3]: b[:,-1]
Out[3]: [4 2]
In [4]: c[:,-1]
Out[4]:
⎡2⎤
⎢ ⎥
⎣4⎦
The input b[:,-1] returns the reversed array [4 2] instead of the expected [2 4]. Using positive indexing for the last column returns the correct result
In [5]: b[:,1]
Out[5]: [2 4]
The text was updated successfully, but these errors were encountered:
yeshsurya
added a commit
to yeshsurya/sympy
that referenced
this issue
May 1, 2018
The negative indexing for sympy.Array seems to be broken.
The input
b[:,-1]
returns the reversed array[4 2]
instead of the expected[2 4]
. Using positive indexing for the last column returns the correct resultThe text was updated successfully, but these errors were encountered: