RE: Relatively prime integers in NumPy

2024-07-12 Thread AVI GROSS via Python-list
v, Dmitry Yu Sent: Friday, July 12, 2024 11:10 PM To: avi.e.gr...@gmail.com; 'Popov, Dmitry Yu via Python-list' ; oscar.j.benja...@gmail.com Subject: Re: Relatively prime integers in NumPy Thank you very much. List comprehensions make code much more concise indeed. Do list com

Re: Relatively prime integers in NumPy

2024-07-12 Thread Popov, Dmitry Yu via Python-list
-list' ; oscar.j.benja...@gmail.com Subject: RE: Relatively prime integers in NumPy Dmitry, I clearly did not understand what you wanted earlier as you had not made clear that in your example, you already had progressed to some level where you had the data and were now doing a second s

RE: Relatively prime integers in NumPy

2024-07-12 Thread AVI GROSS via Python-list
ry Yu via Python-list' ; oscar.j.benja...@gmail.com; Popov, Dmitry Yu Subject: Re: Relatively prime integers in NumPy Thank you very much, Oscar. Using the following code looks like a much better solution than my current Python code indeed. np.gcd.reduce(np.transpose(a)) or np.gc

Re: Relatively prime integers in NumPy

2024-07-12 Thread Popov, Dmitry Yu via Python-list
, Dmitry Yu via Python-list Sent: Thursday, July 11, 2024 2:25 PM To: avi.e.gr...@gmail.com ; 'Popov, Dmitry Yu via Python-list' Subject: Re: Relatively prime integers in NumPy Thank you for your interest. My explanation is too concise indeed, sorry. So far, I have used Python code

Re: Relatively prime integers in NumPy

2024-07-12 Thread Popov, Dmitry Yu via Python-list
vely prime integers h,k,l pass to this block of the code From: avi.e.gr...@gmail.com Sent: Thursday, July 11, 2024 1:22 PM To: Popov, Dmitry Yu ; 'Popov, Dmitry Yu via Python-list' Subject: RE: Relatively prime integers in NumPy Дмитрий, You may think you explained what you

Re: Relatively prime integers in NumPy

2024-07-12 Thread Peter J. Holzer via Python-list
On 2024-07-08 19:09:45 +, Popov, Dmitry Yu via Python-list wrote: > Does NumPy provide a simple mechanism to identify relatively prime > integers, i.e. integers which don't have a common factor other than +1 > or -1? Typing "numpy gcd" into my favourite search engine brings me to https://nump

RE: Relatively prime integers in NumPy

2024-07-11 Thread AVI GROSS via Python-list
, 2024 3:26 PM To: avi.e.gr...@gmail.com; 'Popov, Dmitry Yu via Python-list' Subject: Re: Relatively prime integers in NumPy Thank you for your interest. My explanation is too concise indeed, sorry. So far, I have used Python code with three enclosed 'for' loops for th

Re: Relatively prime integers in NumPy

2024-07-11 Thread Oscar Benjamin via Python-list
(posting on-list this time) On Thu, 11 Jul 2024 at 15:18, Popov, Dmitry Yu via Python-list wrote: > > Dear Sirs. > > Does NumPy provide a simple mechanism to identify relatively prime integers, > i.e. integers which don't have a common factor other than +1 or -1? For > example, in case of this

RE: Relatively prime integers in NumPy

2024-07-11 Thread AVI GROSS via Python-list
Дмитрий, You may think you explained what you wanted but I do not see what result you expect from your examples. Your request is a bit too esoteric to be a great candidate for being built into a module like numpy for general purpose se but I can imagine it could be available in modules build on t