[Numpy-discussion] Re: Endorsing SPECs 1, 6, 7, and 8

2024-10-08 Thread Robert Kern via NumPy-Discussion
On Tue, Oct 8, 2024 at 8:36 AM Nathan via NumPy-Discussion < numpy-discussion@python.org> wrote: > > Since the legacy RNG interface cannot be deprecated and we encourage > downstream to use it in tests according to the text of NEP 19, I'm not sure > about the text in SPEC 7 that talks about deprec

[Numpy-discussion] Re: Canonical way of serialising Generators

2024-10-27 Thread Robert Kern via NumPy-Discussion
On Mon, Oct 28, 2024 at 12:11 AM Andrew Nelson via NumPy-Discussion < numpy-discussion@python.org> wrote: > Hi all, > is there a canonical way of serialising Generators (not via pickle). > Pickle is the canonical way. In particular, the pickle _machinery_ is going to be the single source of truth

[Numpy-discussion] Re: Suggestion to show the shape in repr for summarized arrays

2024-10-01 Thread Robert Kern via NumPy-Discussion
On Tue, Oct 1, 2024 at 9:57 AM Evgeni Burovski via NumPy-Discussion < numpy-discussion@python.org> wrote: > I like this, too. > > And I think the trailing comment, # shape=... is much better, as it gets > the best of both worlds: user get the info, and tools which do > eval(repr(..)) only need to

[Numpy-discussion] Re: [EXTERNAL] Copy on __setitem__

2024-12-26 Thread Robert Kern via NumPy-Discussion
On Thu, Dec 26, 2024 at 5:48 PM Benjamin Root via NumPy-Discussion < numpy-discussion@python.org> wrote: > 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 > ar

[Numpy-discussion] Re: surprising behavior from array indexing

2024-12-30 Thread Robert Kern via NumPy-Discussion
On Mon, Dec 30, 2024 at 10:28 AM Mark Harfouche via NumPy-Discussion < numpy-discussion@python.org> wrote: > Happy new year everybody! > > I've been upgrading my code to start to support array indexing and in my > tests I found something that was well documented, but surprising to me. > > I've tri

[Numpy-discussion] Re: odd behaviour of meshgrid with 3 arrays

2024-11-21 Thread Robert Kern via NumPy-Discussion
On Thu, Nov 21, 2024 at 2:00 PM Slavin, Jonathan via NumPy-Discussion < numpy-discussion@python.org> wrote: > Hi all, > > I was trying to use meshgrid with three arrays and got some odd results. > Here's a simple example: > xt = np.array([1,2,3,4]) > yt = np.array([6,7,8]) > zt = np.array([12,13])

[Numpy-discussion] Re: Proposal to Extend NumPy Broadcasting for (D₁, D₂, ..., N, M) → (D₁, D₂, ..., K, M) When K is a Multiple of N (K % N == 0)

2025-04-05 Thread Robert Kern via NumPy-Discussion
On Tue, Mar 25, 2025 at 9:34 AM Shasang Thummar via NumPy-Discussion < numpy-discussion@python.org> wrote: > *Why Should This Be Allowed?* > > If *a larger dimension is an exact multiple of a smaller one*, then > logically, the smaller array can be *repeated* along that axis *without > physically

[Numpy-discussion] Re: Add Sampling with Dynamic weights with replacement to np.random.choice

2025-05-02 Thread Robert Kern via NumPy-Discussion
On Fri, May 2, 2025 at 9:55 AM Shourya Jain via NumPy-Discussion < numpy-discussion@python.org> wrote: > Feature request : Add replacement based sampling method with weight decay > for choosing samples from a list/array > > I would like to add it with an algorithm as follows : > for _ in range(tar

[Numpy-discussion] Re: Format of arrays to facilitate analysis

2025-02-18 Thread Robert Kern via NumPy-Discussion
On Tue, Feb 18, 2025 at 11:06 AM Dan Patterson wrote: > I tend to work with Nx2 arrays representing coordinate geometry. > I have examined a number of packages and there is no guidelines as to why > a certain arrangement is preferred over the other. > For example: a rectangle, coordinates ordere

[Numpy-discussion] Re: Format of arrays to facilitate analysis

2025-02-18 Thread Robert Kern via NumPy-Discussion
On Tue, Feb 18, 2025 at 3:00 PM Dan Patterson wrote: > So from a purely numpy perspective, there is no advantage if one of > aforementioned coordinate arrangements is used (eg Nx2, ravelled, 2xN). No, not from numpy's side. Some things you want to do will be easier/prettier in one of the arrang

[Numpy-discussion] Re: Functions for secant, cosecant, and cotangent

2025-02-12 Thread Robert Kern via NumPy-Discussion
On Wed, Feb 12, 2025 at 5:12 PM Jayanth Tumuluri via NumPy-Discussion < numpy-discussion@python.org> wrote: > Hello, > > I noticed that current/past installations of Numpy do not have functions > for secant, cosecant, and cotangent. Sometimes, there's a reason to use > these over their less elegan

[Numpy-discussion] Re: Feature Request: Left (and Right) inverse of the Cross Product

2025-06-02 Thread Robert Kern via NumPy-Discussion
On Mon, Jun 2, 2025 at 1:09 PM Oscar Benjamin via NumPy-Discussion < numpy-discussion@python.org> wrote: > In vectors the minimum norm solution for b in a x b = c is just bhat = > (c x a) / |a|^2 so the cross product computes its own "inverse": > > In [135]: np.cross(c, a) / (a**2).sum() > Out[135

[Numpy-discussion] Re: Feature Request: Left (and Right) inverse of the Cross Product

2025-06-02 Thread Robert Kern via NumPy-Discussion
On Mon, Jun 2, 2025 at 9:30 AM Leon Deligny via NumPy-Discussion < numpy-discussion@python.org> wrote: > ### Proposed new feature or change: > > Motivations: This is specific to 3D vector algebra. In Fluid Dynamics, we > have access to the moment of a force at a specific point (M_P = OP \cross > F

[Numpy-discussion] Re: Can't launch Jupyter

2025-06-28 Thread Robert Kern via NumPy-Discussion
On Sat, Jun 28, 2025 at 8:42 AM Kwaku Oppong via NumPy-Discussion < numpy-discussion@python.org> wrote: > can someone helps me. Whenever i ytried to launch Jupyter from Navigator, > this is the message I gets > Sorry, this isn't the place for Jupyter questions. -- Robert Kern __