[Numpy-discussion] Re: Speeding up `unique` and adding "kind" parameter

2022-06-29 Thread Ralf Gommers
On Wed, Jun 29, 2022 at 7:10 AM Miles Cranmer wrote: > Regarding 2., did you have a particular approach in mind? This new lookup > table method is already O(n) scaling (similar to a counting sort), so I > cannot fathom a method that, as you suggest, would get significantly better > performance fo

[Numpy-discussion] Re: Speeding up `unique` and adding "kind" parameter

2022-06-29 Thread Miles Cranmer
So, this new method is in fact a hash table as discussed in that blog post. However, because it assumes integer arrays, we can go even further than that blog, and simply use `np.arange(ar_min, ar_max + 1)` is the "hash table". Thus, you don't actually need to use a hashing function at all, you c

[Numpy-discussion] Re: Speeding up `unique` and adding "kind" parameter

2022-06-29 Thread Ralf Gommers
On Wed, Jun 29, 2022 at 2:59 PM Miles Cranmer wrote: > So, this new method is in fact a hash table as discussed in that blog > post. However, because it assumes integer arrays, we can go even further > than that blog, and simply use `np.arange(ar_min, ar_max + 1)` is the "hash > table". Thus, you

[Numpy-discussion] Re: Speeding up `unique` and adding "kind" parameter

2022-06-29 Thread Miles Cranmer
My pleasure! Cheers, Miles ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail

[Numpy-discussion] Re: Speeding up `unique` and adding "kind" parameter

2022-06-29 Thread Sebastian Berg
On Wed, 2022-06-29 at 12:56 +, Miles Cranmer wrote: > So, this new method is in fact a hash table as discussed in that blog > post. However, because it assumes integer arrays, we can go even > further than that blog, and simply use `np.arange(ar_min, ar_max + > 1)` is the "hash table". Thus, yo

[Numpy-discussion] Re: Changes to `np.loadtxt(..., max_rows=)`

2022-06-29 Thread Sebastian Berg
Hi all, these changes came up in https://github.com/numpy/numpy/issues/21852 where a user had the use-case to look up the line number until where they want to read a file. The change is that `max_rows` now: * Represents the number of *rows* in the result * Gives a `UserWarning` when empty lines a

[Numpy-discussion] Setting C and linker flags for Windows build

2022-06-29 Thread Matthew Brett
Hi, I am very sorry - I feel I should know this, or be able to work it out, but is there a way of setting the flags to the C compiler and the linker, for the Numpy build, on Windows? I'm trying to set the flags for a build with Windows mingw-w64 - but I believe Numpy is ignoring $env:LDFLAGS, $en

[Numpy-discussion] Re: Setting C and linker flags for Windows build

2022-06-29 Thread Kevin Sheppard
> > > Hi, > > I am very sorry - I feel I should know this, or be able to work it > out, but is there a way of setting the flags to the C compiler and the > linker, for the Numpy build, on Windows? > > I'm trying to set the flags for a build with Windows mingw-w64 - but I > believe Numpy is ignoring