Seems to make sense to me? Or is the following a bug?
>>> import numpy as np
>>> u = np.zeros(5)
>>> v = np.ones(5)
>>> u
array([0., 0., 0., 0., 0.])
>>> u[...] = v
>>> u
array([1., 1., 1., 1., 1.])
>>> v[4] = 5
>>> v
array([1., 1., 1., 1., 5.])
>>> u
array([1., 1., 1., 1., 1.])
If you don't do a
When I usually need to do something like that, I just construct a tuple of
slice() objects. No need to use swapaxes(). Or am I missing something?
On Sat, Feb 1, 2025 at 10:24 AM Michael Mullen
wrote:
> Hello,
>
> I am writing a class handling NumPy arrays, and basing it off some
> computations I
Shasang,
My main concern is that if there is a legitimate bug in someone's code that
is causing mismatched array sizes, this can mask that bug in certain
situations where the mismatch just so happens to produce arrays of certain
shapes. I am intrigued by the idea, though.
Ben Root
On Tue, Mar 25
I'm looking at a situation where I like to wrap a C++ function that takes
two doubles as inputs, and returns an error code, a position vector, and a
velocity vector so that I essentially would have a function signature of
(N), (N) -> (N), (N, 3), (N, 3). When I try to use np.vectorize() or
np.fromp
Discussion <
numpy-discussion@python.org> wrote:
> On Fri, Jun 27, 2025 at 5:29 PM Benjamin Root via NumPy-Discussion
> wrote:
> >
> > I'm looking at a situation where I like to wrap a C++ function that
> takes two doubles as inputs, and returns an error code, a pos