[Numpy-discussion] Re: Exact representable difference between for two arrays.

2024-12-20 Thread Andrea Gavana via NumPy-Discussion
Hi Andrew, I have no clue what future versions of Python will do, but on my setup there is no optimization done on this (I have taken arrays as float32, just to show the differences better): In [19]: N = 10 In [20]: x0 = numpy.random.uniform(size=(N, )).astype(numpy.float32) In [21]: h = numpy.ra

[Numpy-discussion] Re: Polyfit error in displacement

2024-03-25 Thread Andrea Gavana
On Mon, 25 Mar 2024 at 20:09, Charles R Harris wrote: > > > On Mon, Mar 25, 2024 at 11:28 AM Luca Bertolotti < > luca72.bertolo...@gmail.com> wrote: > >> Hello >> in a vb program they use 3rd degree approx and get this value including >> displacement:(SC) >> [image: image.png] >> >> Ii think that

Re: [Numpy-discussion] C-coded dot 1000x faster than numpy?

2021-02-23 Thread Andrea Gavana
Hi, On Tue, 23 Feb 2021 at 19.11, Neal Becker wrote: > I have code that performs dot product of a 2D matrix of size (on the > order of) [1000,16] with a vector of size [1000]. The matrix is > float64 and the vector is complex128. I was using numpy.dot but it > turned out to be a bottleneck. >

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-12 Thread Andrea Gavana
Hi, On Mon, 12 Oct 2020 at 16.22, Hongyi Zhao wrote: > On Mon, Oct 12, 2020 at 9:33 PM Andrea Gavana > wrote: > > > > Hi, > > > > On Mon, 12 Oct 2020 at 14:38, Hongyi Zhao wrote: > >> > >> On Sun, Oct 11, 2020 at 3:42 PM Evgeni Burovski > &g

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-12 Thread Andrea Gavana
ifting your implementation to C/Cython or Fortran/f2py. I had much better results myself using Fortran/f2py than pure NumPy or C/Cython, but this is mostly because my knowledge of Cython is quite limited. That said, your problem should be fairly easy to implement in a compiled language. Andrea. >

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Andrea Gavana
On Sun, 11 Oct 2020 at 07.52, Hongyi Zhao wrote: > On Sun, Oct 11, 2020 at 1:33 PM Andrea Gavana > wrote: > > > > > > > > On Sun, 11 Oct 2020 at 07.14, Andrea Gavana > wrote: > >> > >> Hi, > >> > >> On Sun, 11 Oct 2020 at 00.

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Andrea Gavana
On Sun, 11 Oct 2020 at 07.14, Andrea Gavana wrote: > Hi, > > On Sun, 11 Oct 2020 at 00.27, Hongyi Zhao wrote: > >> On Sun, Oct 11, 2020 at 1:48 AM Robert Kern >> wrote: >> > >> > You don't need to use vectorize() on fermi(). fermi() will work j

Re: [Numpy-discussion] The mu.py script will keep running and never end.

2020-10-10 Thread Andrea Gavana
Hi, On Sun, 11 Oct 2020 at 00.27, Hongyi Zhao wrote: > On Sun, Oct 11, 2020 at 1:48 AM Robert Kern wrote: > > > > You don't need to use vectorize() on fermi(). fermi() will work just > fine on arrays and should be much faster. > > Yes, it really does the trick. See the following for the benchma

Re: [Numpy-discussion] Proposal to add clause to license prohibiting use by oil and gas extraction companies

2020-07-01 Thread Andrea Gavana
On Wed, 1 Jul 2020 at 21.23, gyro funch wrote: > Hello, > > I greatly respect the intention, but this is a very slippery slope. > > Will you exempt groups within these companies that are working on > 'green' technologies (e.g., biofuels)? > > Will you add to the license restrictions companies who

Re: [Numpy-discussion] PEP 574 - zero-copy pickling with out of band data

2018-07-03 Thread Andrea Gavana
Hi, On Tue, 3 Jul 2018 at 09.20, Gael Varoquaux wrote: > On Tue, Jul 03, 2018 at 08:54:51AM +0200, Andrea Gavana wrote: > > This sound so very powerful... it’s such a pity that these type of gems > won’t > > be backported to Python 2 - we have so many legacy applications sm

Re: [Numpy-discussion] PEP 574 - zero-copy pickling with out of band data

2018-07-02 Thread Andrea Gavana
On Tue, 3 Jul 2018 at 07.35, Gael Varoquaux wrote: > On Mon, Jul 02, 2018 at 05:31:05PM -0600, Charles R Harris wrote: > > ISTR that some parallel processing applications sent pickled arrays > around to > > different processes, I don't know if that is still the case, but if so, > no copy > > migh

Re: [Numpy-discussion] List comprehension and loops performances with NumPy arrays

2017-10-08 Thread Andrea Gavana
unbeatable, thanks for the analysis! Andrea. > Cheers, > > > > -- > Nicholas Nadeau, P.Eng., AVS > > On 7 October 2017 at 05:56, Andrea Gavana wrote: > >> Apologies, correct timeit code this time (I had gotten the wrong shape >> for the output matrix in the loop case): &

Re: [Numpy-discussion] List comprehension and loops performances with NumPy arrays

2017-10-07 Thread Andrea Gavana
print method, ': MIN: %0.2f ms , MAX: %0.2f ms , MEAN: %0.2f ms , BEST OF 3: %0.2f ms'%tuple(result.tolist()) Results are the same as before... On 7 October 2017 at 11:52, Andrea Gavana wrote: > Hi All, > > I have this little snippet of code: > > import timeit > impor

[Numpy-discussion] List comprehension and loops performances with NumPy arrays

2017-10-07 Thread Andrea Gavana
Hi All, I have this little snippet of code: import timeit import numpy class Item(object): def __init__(self, name): self.name = name self.values = numpy.random.rand(8, 1) def do_something(self): sv = self.values.sum(axis=0) array = numpy.empty((8,