[Numpy-discussion] Re: Adding bfill() to numpy.

2024-05-22 Thread Raquel Braunschweig via NumPy-Discussion
Thank you for the suggestion. We will look into it! ___ 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/

[Numpy-discussion] Adding bfill() to numpy.

2024-05-20 Thread Raquel Braunschweig via NumPy-Discussion
Hello everyone, My colleague and I will be opening a Pull Request (PR) about adding bfill() (backward fill) function to NumPy. This function is designed to fill NaN values in an array by propagating the next valid observation backward along a specified axis. We believe this addition will be

[Numpy-discussion] .npy MIME type?

2024-05-17 Thread None via NumPy-Discussion
Hi, As I wanted to have a textual preview of .npy files, I noticed that there is no support (partial support in magic, none in xdg-mime upstream), and simply no documented MIME type (official or not), for the .npy file format. Would it be reasonable to consider application/x-numpy (which is

[Numpy-discussion] Should we add a NumPy default protocol version for np.save?

2024-05-07 Thread Chunqing Shan via NumPy-Discussion
Currently, when NumPy saves data using pickle, it hard-coded the protocol version to 3, which was the default value from Python 3.0 to Python 3.7. However, since Python 3.7 has reached its end-of-life (EOL), there are no actively maintained Python versions that default to using pickle protocol 3.

[Numpy-discussion] np.where and ZeroDivisionError: float division by zero

2024-04-25 Thread 840362492--- via NumPy-Discussion
0 In my code, I use the following calculation for a column in the dataframe: np.where(df_score['number'] ! = 0, 100 - ((100 * df_score[rank_column] -50)/df_score['number']), None),I have used df_score['number']! = 0, but the code is still wrong, ZeroDivisionError: float division by zero, even

[Numpy-discussion] Re: (no subject)

2024-04-23 Thread steven.kakaire--- via NumPy-Discussion
On 2024-04-19 07:20, Shreya Nalawade wrote: Dear Sir/Madam I want to contribute to the GSOD Numpy. Till when are the proposal accepted plus what should be the format of the proposals. Kindly guide me through the organisation policies and contribution guidelines.

[Numpy-discussion] Accelerated NumPy with Weld compiler

2024-03-21 Thread Hemant Singh via NumPy-Discussion
Stanford and MIT jointly developed the Weld language and compiler to run NumPy and Pandas significantly faster, 10x-250x. My company has changed the compiler to be production ready. Anyone interested in trialing this compiler, please contact me with your work email. Best, Hemant

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-15 Thread Alexander Levin via NumPy-Discussion
Hi Stéfan, upd: indeed, rfft2 has equal memory usage with our fft2d in terms of reals. thanks, Stefan. to this moment, i believe the results are following: > scipy time outperformance on rectangular signals with sides of power-of-two. > equal memory usage with rfft2 in my eyes, it's worth

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-14 Thread Alexander Levin via NumPy-Discussion
Hi Stefan, indeed you're right, the underlying formula initially was created by V. Tutatchikov for power-of-two matrices. The initial butterfly approach requires a recursive breakdown to 2x2 matrix in order to proceed with precalculations of roots of unity (exactly what provides you the

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-14 Thread Stefan van der Walt via NumPy-Discussion
Hi Alexander, On 2024-03-14 22:43:38, Alexander Levin via NumPy-Discussion wrote: Memory Usage - https://github.com/2D-FFT-Project/2d-fft/blob/testnotebook/notebooks/memory_usage.ipynb Timing comparisons(updated) - https://github.com/2D-FFT-Project/2d-fft/blob/testnotebook/notebooks

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-14 Thread Alexander Levin via NumPy-Discussion
Good day, Ralf. I am sharing the results of the latest updates on our code. We have taken into account the comments below and are testing the timing with %timeit -o inside jupyter, having information about the best of 7 code passes and the average deviation. Writing to summarise the

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-12 Thread Alexander Levin via NumPy-Discussion
thanks for your extensive feedback. if i got you right, we can't state the outperformance in all cases, because it is measured by an insufficiently precise function and a relatively short period of time. I understand your point of view and thank you for your observation. we will start working

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-12 Thread via NumPy-Discussion
i appreciate your correction, indeed you are right, it was my fault. i changed everything and i believe it is in the correct order of things right now. our current best result is FFT: -46%(no multithreading, no type conversions) from scipy and +0.37% is the worst case (multithreaded, no type

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-11 Thread via NumPy-Discussion
Good afternoon, Ralf. We have done some of the measurements you recommended, for your convenience we have created a separate folder with notebooks where we measured memory usage and performance of our interpretation against Scipy. Separately you can run the tests on your hardware and

[Numpy-discussion] Re: Improved 2DFFT Approach

2024-03-05 Thread via NumPy-Discussion
Good evening, Ralf! I beg your pardon, for some reason I didn't get the notification of your response to this issue and couldn't answer in a more timely fashion. We'll cover all the mentioned points in shortest time possible (also some university and job projects) and I really appreciate such

[Numpy-discussion] Re: JSON format for multi-dimensional data

2024-02-28 Thread fangqq--- via NumPy-Discussion
aside from the previously mentioned ticket https://github.com/numpy/numpy/issues/12481, I also made a similar proposal, posted in 2021 https://github.com/numpy/numpy/issues/20461 https://mail.python.org/archives/list/numpy-discussion@python.org/message/EVQW2PO64464JEN3RQXSCDP32RQDIQFW/

[Numpy-discussion] Improved 2DFFT Approach

2024-02-27 Thread camrymanjr--- via NumPy-Discussion
Good day! My name is Alexander Levin. My colleague and I did a project on optimisation of two-dimensional Fourier transform algorithm six months ago. We took your implementation of numpy fft2d as a unit of quality. In the course of our research we found out that initially mathematically the

[Numpy-discussion] builing numpy on windows

2024-02-27 Thread Ganesh Rajora via NumPy-Discussion
Hi Team, I am Ganesh working for an MNC here in India and I am working on customised Python where I build set of python modules with python. I do not install them directly from web but I build each and everything from source code.  this is because security concerns at the organisation.  In

[Numpy-discussion] Need help in numpy building from source on windows.

2024-02-26 Thread rajoraganesh--- via NumPy-Discussion
detailed proble can be found at - https://stackoverflow.com/questions/78059816/issues-in-buildingnumpy-from-source-on-windows ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to

[Numpy-discussion] Re: Introducing quarterly date units to datetime64 and timedelta64

2024-02-24 Thread Stefano Miccoli via NumPy-Discussion
Actually quarters (3 months sub-year groupings) are already supported as ‘M8[3M]’ and ‘m8[3M]’: >>> np.datetime64('2024-05').astype('M8[3M]') - np.datetime64('2020-03').astype('M8[3M]') numpy.timedelta64(17,'3M') So explicitly introducing a ‘Q’ time unit is only to enable more

[Numpy-discussion] Re: New DType and ArrayMethod C APIs are public

2024-02-14 Thread Stefan van der Walt via NumPy-Discussion
On Wed, Feb 14, 2024, at 14:34, Nathan wrote: > The DType API publicly exposes the PyArray_DTypeMeta C struct, which > represents DType metaclasses. It also exposes a function for registering > user-defined DTypes and a set of slot IDs and function typedefs that users > can implement in C to

[Numpy-discussion] Re: API: make numpy.lib._arraysetops.intersect1d work on multiple arrays #25688

2024-02-06 Thread Stephan Kuschel via NumPy-Discussion
Dear Dom, just check, and on my computer the new version is ~factor 2 faster compared to the reduce approach if arrays are shuffled. For sorted arrays, the the new version is factor 3.4. faster: from functools import reduce idss = [np.random.permutation(np.arange(a*100, int(1e5)+a*100, 1))

[Numpy-discussion] Re: API: make numpy.lib._arraysetops.intersect1d work on multiple arrays #25688

2024-02-06 Thread Stephan Kuschel via NumPy-Discussion
Dear Dom, thanks for bringing up the possible constriction. I agree that this would be serious argument against the change. However, as you said the overlapping/non-overlapping indices would become ambiguous with more than two arrays. And calling the fucntion with only two arrays at a time

[Numpy-discussion] API: make numpy.lib._arraysetops.intersect1d work on multiple arrays #25688

2024-02-02 Thread Stephan Kuschel via NumPy-Discussion
Dear Community, For my own work, I required the intersect1d function to work on multiple arrays while returning the indices (using `return_indizes=True`). Consequently I changed the function in numpy and now I am seeking feedback from the community. This is the corresponding PR:

[Numpy-discussion] Re: welcome Raghuveer, Chris, Mateusz and Matt to the NumPy maintainers team

2024-01-27 Thread Hameer Abbasi via NumPy-Discussion
Welcome, Raghuveer, Chris, Mateusz and Matt! > Am 26.01.2024 um 21:04 schrieb Ralf Gommers : > > Hi all, > > We've got four new NumPy maintainers! Welcome to the team, and > congratulations to: > > - Raghuveer Devulapalli (https://github.com/r-devulap) > - Chris Sidebottom

[Numpy-discussion] Re: welcome Raghuveer, Chris, Mateusz and Matt to the NumPy maintainers team

2024-01-26 Thread Stefan van der Walt via NumPy-Discussion
On Fri, Jan 26, 2024, at 12:04, Ralf Gommers wrote: > We've got four new NumPy maintainers! Welcome to the team, and > congratulations to: > > - Raghuveer Devulapalli (https://github.com/r-devulap) > - Chris Sidebottom (https://github.com/mousius) > - Mateusz Sokół (https://github.com/mtsokol/)

[Numpy-discussion] Re: ENH: Efficient operations on already sorted arrays

2024-01-16 Thread Peter Schneider-Kamp via NumPy-Discussion
Dear all, I second Yagiz’ proposal. I do, however, see that we need to ensure code style (and probably other forms of) consistency before merging these new functions in. And, particularly important, adherence to the conventions of function and method names. Cheers, Peter From: Yağız Ölmez

[Numpy-discussion] Re: New Ruff rule for migrating to NumPy 2.0

2024-01-11 Thread Peter Cock via NumPy-Discussion
This looks handy - I used the following to try it: $ pip install -U ruff $ ruff --preview --select NPY201 --fix Happily nothing to address on the code baseI tried. Thanks, Peter On Thu, Jan 11, 2024 at 11:32 AM Mateusz Sokol wrote: > > Hi all! > > Some time ago we added a new rule to Ruff

[Numpy-discussion] PyData yerevan chapter - sprint

2024-01-09 Thread Habet Madoyan via NumPy-Discussion
Dear community members, I am Habet, the co-founder and organizer of the PyData Yerevan chapter. We are planning to host a contributors' sprint for NumPy in Yerevan, Armenia, during one of our upcoming monthly meetups in either February or March. We have allocated a modest budget to facilitate the

[Numpy-discussion] Re: How is "round to N decimal places" defined for binary floating point numbers?

2023-12-29 Thread Stefano Miccoli via NumPy-Discussion
Oscar Gustafsson wrote: > I would take it that round x to N radix-R digits means > round_to_integer(x * R**N)/R**N > (ignoring floating-point issues) Yes, this is the tried-and-true way: first define the function in exact arithmetic, then ask for the floating point implementation to return an

[Numpy-discussion] How is "round to N decimal places" defined for binary floating point numbers?

2023-12-28 Thread Stefano Miccoli via NumPy-Discussion
I have always been puzzled about how to correctly define the python built-in `round(number, ndigits)` when `number` is a binary float and `ndigits` is greater than zero. Apparently CPython and numpy disagree: >>> round(2.765, 2) 2.77 >>> np.round(2.765, 2) 2.76

[Numpy-discussion] Re: Meson - C extension - Finding numpy includes in virtual env

2023-11-28 Thread Stefan van der Walt via NumPy-Discussion
Hi Nathan, On Tue, Nov 28, 2023, at 08:42, Nathan wrote: > It looks like `spin build` does `meson build` and `meson install` and doesn't > do `pip install`. I'd like numpy to be importable in a python environment of > my choosing, so I tend to instead manually install numpy into that >

[Numpy-discussion] Re: Meson - C extension - Finding numpy includes in virtual env

2023-11-26 Thread Stefan van der Walt via NumPy-Discussion
On Sun, Nov 26, 2023, at 12:03, Nathan wrote: > For my work I tend to use a persistent build directory with build isolation > disabled as discussed in the meson-python docs. Out of curiosity, how is this different from, e.g., `spin build` which builds into `./build-install`? Stéfan

[Numpy-discussion] Re: Meson - C extension - Finding numpy includes in virtual env

2023-11-26 Thread Stefan van der Walt via NumPy-Discussion
Hi Doug, On Sun, Nov 26, 2023, at 06:29, Doug Turnbull wrote: > To debug, I ran `pip install . --no-build-isolation` it worked (using venv's > numpy) When developing NumPy, we typically build in the existing environment. This is done either via `pip install -e .` (which installs hooks to

[Numpy-discussion] Re: Meson - C extension - Finding numpy includes in virtual env

2023-11-25 Thread Stefan van der Walt via NumPy-Discussion
Hi Doug, On Sat, Nov 25, 2023, at 07:14, Doug Turnbull wrote: > Unfortunately the following command fails: > > incdir_numpy = run_command(py, > ['-c', 'import numpy; print(numpy.get_include())'], > capture: true, > check: false, > ).stdout().strip() In your repo it says stderr, but the

[Numpy-discussion] Re: How to sample unique vectors

2023-11-17 Thread Stefan van der Walt via NumPy-Discussion
On Fri, Nov 17, 2023, at 16:52, Robert Kern wrote: > That optimistic optimization makes this the fastest solution. That'd work great, thanks Robert, Aaron, and everyone who shared input. Stéfan___ NumPy-Discussion mailing list --

[Numpy-discussion] Re: How to sample unique vectors

2023-11-17 Thread Stefan van der Walt via NumPy-Discussion
On Fri, Nov 17, 2023, at 14:28, Stefan van der Walt wrote: > Attached is a script that implements this solution. And the version with set duplicates checking. Stéfan import random import functools import itertools import operator import numpy as np def cumulative_prod(arr): return

[Numpy-discussion] Re: How to sample unique vectors

2023-11-17 Thread Stefan van der Walt via NumPy-Discussion
On Fri, Nov 17, 2023, at 11:07, Robert Kern wrote: > If the arrays you are drawing indices for are real in-memory arrays for > present-day 64-bit computers, this should be adequate. If it's a notional > array that is larger, then you'll need actual arbitrary-sized integer > sampling. The

[Numpy-discussion] How to sample unique vectors

2023-11-17 Thread Stefan van der Walt via NumPy-Discussion
Hi all, I am trying to sample k N-dimensional vectors from a uniform distribution without replacement. It seems like this should be straightforward, but I can't seem to pin it down. Specifically, I am trying to get random indices in an d0 x d1 x d2.. x dN-1 array. I thought about sneaking in

[Numpy-discussion] Assessment of the difficulty in porting CPU architecture for numpy

2023-11-16 Thread xuanbao via NumPy-Discussion
Hello everyone! I am working on implementing a tool to assess the complexity of CPU architecture porting. It primarily focuses on RISC-V architecture porting. In fact, the tool may have an average estimate of various architecture porting efforts.My focus is on the overall workload and

[Numpy-discussion] Black style as applied to np.array(...) and the ruff formatter

2023-11-03 Thread Peter Cock via NumPy-Discussion
Hello all, I imagine there are many people here using the black coding style as implemented by the tool black, albeit with reservations about how it lays out arrays by default (often therefore wrapped in a format off/on block to exclude the array from automatic layout to allow for manual column

[Numpy-discussion] Re: Change in numpy.percentile

2023-10-11 Thread Peter Cock via NumPy-Discussion
On Tue, Oct 10, 2023 at 6:32 PM Matthew Brett wrote: > Hi, > > > On Tue, 10 Oct 2023 at 00:55, Andrew Nelson wrote: > > > > > > On Mon, 9 Oct 2023 at 23:50, Matthew Brett > wrote: > >> > >> Hi, > >> > >> On Mon, Oct 9, 2023 at 11:49 AM Andrew Nelson > wrote: > >> Could you say more about why

[Numpy-discussion] [JOB] Astropy Research Software engineer

2023-08-04 Thread Aldcroft, Thomas via NumPy-Discussion
Astropy is hiring a Research Software engineer. We are looking for people who can spend 50-100% of their time on Astropy development in the next 6-9 months. Qualified candidates can range from software developers with open source experience to astronomy students with software experience. *If

[Numpy-discussion] Re: mixed mode arithmetic

2023-07-11 Thread Jens Glaser via NumPy-Discussion
Hi Matti, The documentation for numpy.dot currently states """ out ndarray, optional Output argument. This must have the exact kind that would be returned if it was not used. In particular, it must have the right type, must be C-contiguous, and its dtype must be the dtype that would be

[Numpy-discussion] Re: mixed mode arithmetic

2023-07-09 Thread glaserj--- via NumPy-Discussion
Neal Becker wrote: > I've been browsing the numpy source. I'm wondering about mixed-mode > arithmetic on arrays. I believe the way numpy handles this is that it > never does mixed arithmetic, but instead converts arrays to a common type. > Arguably, that might be efficient for a mix of say,

[Numpy-discussion] Re: Precision changes to sin/cos in the next release?

2023-05-31 Thread Allan, Daniel via NumPy-Discussion
Thanks for your work on this, Sebastian. I think there is a benefit for new users and learners to have visually obviously-correct results for the identities. The SciPy Developer's Guide [1] several of us worked on last week uses Snell's Law as a teaching example, and it would now give some

[Numpy-discussion] Re: Precision changes to sin/cos in the next release?

2023-05-31 Thread Stefano Miccoli via NumPy-Discussion
On 31 May 2023, at 16:32, numpy-discussion-requ...@python.org wrote: It seems fairly clear that with this recent change, the feeling is that the tradeoff is bad and that too much accuracy was lost, for not enough real-world gain. However, we now

[Numpy-discussion] Installing numpy on an "unsupported" platform

2023-05-23 Thread asyropoulos--- via NumPy-Discussion
Hello, I am using Python 3.10.0 on OpenIndiana and yesterday I tried to install numpy in my system. The command /opt/gnu/python/bin/python3.10 -m pip install --user numpy failed and it it printed a long error report. The errors are of the form from

[Numpy-discussion] Re: update / revision suggest around f2py

2023-04-14 Thread nbehrnd--- via NumPy-Discussion
Thank you, the issue is filed (https://github.com/numpy/numpy/issues/23592) as relevant to numpy's documentation. ___ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org

[Numpy-discussion] update / revision suggest around f2py

2023-04-13 Thread nbehrnd--- via NumPy-Discussion
Dear maintainers of the documentation, Python numpy includes f2py to access functionality (and performance) of Fortran modules, which https://numpy.org/doc/stable/f2py/f2py.getting-started.html#the-smart-way aims to present. However, I was not able to successfully replicate fully either one

[Numpy-discussion] PR-23061

2023-03-25 Thread Matteo Raso via NumPy-Discussion
I have an open PR that's been reviewed but keeps getting dropped. Specifically, I've had to make a comment asking for updates on the PR's status 3 times, with the last comment going ignored. I'm not upset, since I understand that the team is very busy (I actually looked through the archives a

[Numpy-discussion] Re: removing NUMPY_EXPERIMENTAL_ARRAY_FUNCTION env var

2023-03-10 Thread Hameer Abbasi via NumPy-Discussion
+1 from my side as well.Von meinem iPhone gesendetAm 10.03.2023 um 19:10 schrieb Stephan Hoyer :+1 for removing this environment variable. It was never intended to stick around this long.On Fri, Mar 10, 2023 at 6:48 AM Ralf Gommers wrote:Hi all,In

[Numpy-discussion] Looking for insights and Authors for some ideas

2023-03-02 Thread kritis--- via NumPy-Discussion
Hi All, Packt, an established publishing company (https://www.packtpub.com), is looking for authors to develop two books with the following working titles “Clean architecture in Python” and “Domain Driven Design in Python”. If this is something you would be interested to work on, please email

[Numpy-discussion] Re: Invalid value encoutered : how to prevent numpy.where to do this?

2023-02-18 Thread Hameer Abbasi via NumPy-Discussion
Hi! You can use a context manager: with np.errstate(all=”ignore”): … Best regards, Hameer Abbasi Von meinem iPhone gesendet > Am 18.02.2023 um 16:00 schrieb David Pine : > > I agree. The problem can be avoided in a very inelegant way by turning > warnings off before calling where() and