We could expand this topic for a broader perspective.
Pandas offers "custom accessors," empowering users to extend DataFrame
functionality, while Polars introduces "Expression plugins" for customization,
enhancing DataFrame operations. These features are pretty awesome.
The obvious advantage, the
This idea looks interesting, but I think that having a pipeline method like
`Sequential in PyTorch` would be more intuitive than this approach.
On Thu, Feb 15, 2024, 8:48 PM wrote:
> Hello Numpy community,
>
> I'm proposing the introduction of a `pipe` method for NumPy arrays to
> enhance their
Good to know it is not only on my PC.
I have done a fair bit of work trying to find more efficient sum.
The only faster option that I have found was PyTorch. (although thinking about
it now maybe it’s because it was using MKL, don’t remember)
MKL is faster, but I use OpenBLAS.
Scipp library is
On Fri, Feb 16, 2024 at 12:40 AM Marten van Kerkwijk
wrote:
> > From my experience, calling methods is generally faster than
> > functions. I figure it is due to having less overhead figuring out the
> > input. Maybe it is not significant for large data, but it does make a
> > difference even whe
> On 16 Feb 2024, at 2:48 am, Marten van Kerkwijk
> wrote:
>
>> In [45]: %timeit np.add.reduce(a, axis=None)
>> 42.8 µs ± 2.44 µs per loop (mean ± std. dev. of 7 runs, 10,000 loops each)
>>
>> In [43]: %timeit dotsum(a)
>> 26.1 µs ± 718 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops ea
> One more thing to mention on this topic.
>
> From a certain size dot product becomes faster than sum (due to
> parallelisation I guess?).
>
> E.g.
> def dotsum(arr):
> a = arr.reshape(1000, 100)
> return a.dot(np.ones(100)).sum()
>
> a = np.ones(10)
>
> In [45]: %timeit np.add.reduce
Thanks for this, every little helps.
One more thing to mention on this topic.
From a certain size dot product becomes faster than sum (due to parallelisation
I guess?).
E.g.
def dotsum(arr):
a = arr.reshape(1000, 100)
return a.dot(np.ones(100)).sum()
a = np.ones(10)
In [45]: %time
> From my experience, calling methods is generally faster than
> functions. I figure it is due to having less overhead figuring out the
> input. Maybe it is not significant for large data, but it does make a
> difference even when working for medium sized arrays - say float size
> 5000.
>
> %timei
Hi all,
in PyTorch they (kind of) recently introduced torch.compile:
https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html
In TensorFlow, eager execution needs to be activated manually, otherwise it
creates a graph object which then acts like this kind of pipe.
Don‘t know whet
Just to clarify, I am not the one who suggested pipes. :)
Read the issue. My 2 cents:
From my experience, calling methods is generally faster than functions. I
figure it is due to having less overhead figuring out the input. Maybe it is
not significant for large data, but it does make a differe
> What were your conclusions after experimenting with chained ufuncs?
>
> If the speed is comparable to numexpr, wouldn’t it be `nicer` to have
> non-string input format?
>
> It would feel a bit less like a black-box.
I haven't gotten further than it yet, it is just some toying around I've
been
What were your conclusions after experimenting with chained ufuncs?
If the speed is comparable to numexpr, wouldn’t it be `nicer` to have
non-string input format?
It would feel a bit less like a black-box.
Regards,
DG
> On 15 Feb 2024, at 22:52, Marten van Kerkwijk wrote:
>
> Hi Oyibo,
>
>>
Hi Oyibo,
> I'm proposing the introduction of a `pipe` method for NumPy arrays to enhance
> their usability and expressiveness.
I think it is an interesting idea, but agree with Robert that it is
unlikely to fly on its own. Part of the logic of even frowning on
methods like .mean() and .sum() i
On Thu, Feb 15, 2024 at 10:21 AM wrote:
> Hello Numpy community,
>
> I'm proposing the introduction of a `pipe` method for NumPy arrays to
> enhance their usability and expressiveness.
>
Adding a prominent method like this to `np.ndarray` is something that we
will probably not take up ourselves
14 matches
Mail list logo