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
[Discussion]NumPy-like behavior in Array module #16911
Comments
I think, the |
Yes, I agree with you. I would also like to know them. :-) def zeros(cls, *shape):
list_length = functools.reduce(lambda x, y: x*y, shape, S.One)
return cls._new(([0]*list_length,), shape) In fact, the
here we use a tuple to represent the |
Yes, that would be optimal. Many users are used to NumPy's syntax, so the difference may be an obstacle to the adoption of SymPy. |
Ok I would try to make both parameters acceptable! |
@Upabjojr Regarding the index syntax, do you have some comments?
Personnally, I have found several differences between those module:
I will test it more properly to list out the differences. |
I think that |
I agree we should take NumPy as a reference. As the array module is still pretty young, we are still on time to change behaviour. |
The idea comes originally from this issue #15464.
I have noticed that the initialization of an
Array
, in some case, accepts only a sequence of int, rather than a tuple like we do in NumPy.@Upabjojr has also noticed a difference of behavior between SymPy and NumPy. I would give the floor to him so that the problem can be illustrated clearly. (Thank you!)
In my opinion, it would be good if we follow the example of NumPy in syntax and behaviors of
Array
. Besides, as far as I know,Array
module is recently created, so it could be eligible to some changes.Based on this topic, what do you think about it?
The text was updated successfully, but these errors were encountered: