[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Alan
Why do these belong in NumPy? What is the broad field of application of
these functions? And, does a more general concept underpin them?
Thanks, Alan Isaac

On Tue, Jan 23, 2024 at 5:17 PM Marten van Kerkwijk 
wrote:

> Hi All,
>
> I have a PR [1] that adds `np.matvec` and `np.vecmat` gufuncs for
> matrix-vector and vector-matrix calculations, to add to plain
> matrix-matrix multiplication with `np.matmul` and the inner vector
> product with `np.vecdot`.  They call BLAS where possible for speed.
> I'd like to hear whether these are good additions.
>
> I also note that for complex numbers, `vecmat` is defined as `x†A`,
> i.e., the complex conjugate of the vector is taken. This seems to be the
> standard and is what we used for `vecdot` too (`x†x`). However, it is
> *not* what `matmul` does for vector-matrix or indeed vector-vector
> products (remember that those are possible only if the vector is
> one-dimensional, i.e., not with a stack of vectors). I think this is a
> bug in matmul, which I'm happy to fix. But I'm posting here in part to
> get feedback on that.
>
> Thanks!
>
> Marten
>
> [1] https://github.com/numpy/numpy/pull/25675
>
> p.s. Separately, with these functions available, in principle these
> could be used in `__matmul__` (and thus for `@`) and the specializations
> in `np.matmul` removed. But that can be a separate PR (if it is wanted
> at all).
> ___
> 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: alan.is...@gmail.com
>
___
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-archive.com


[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Alan
On Wed, Jan 24, 2024 at 2:27 PM Marten van Kerkwijk 
wrote:

> > Why do these belong in NumPy? What is the broad field of application of
> these functions? And,
> > does a more general concept underpin them?
>
> Multiplication of a matrix with a vector is about as common as matrix
> with matrix or vector with vector, and not currently easy to do for
> stacks of vectors, so I think the case for matvec is similarly strong as
> that for matmul and vecdot.
>
> Arguably, vecmat is slightly less common, though completes the quad.
>
> -- Marten
>
>



Could you please offer some code or math notation to help communicate this?
I am forced to guess at the need.

The words "matrix" and "vector" are ambiguous.
After all, matrices (of given shape) are a type of vector (i.e., can be
added and scaled.)
So if by "matrix" you mean "2d array" and by "stack of vectors" you
effectively mean "2d array",
this sounds like a use for np.dot (possibly after a transpose).
However I am going to guess that here by "vector" you actually mean a matrix
(i.e., a 2d array) with only one row or only one column, so a "stack" of
them
is actually 3d. Perhaps the needless dimension is then the real problem
and can either not be produced or can be squeezed away..

Thanks, Alan Isaac
___
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-archive.com


[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-25 Thread Alan
On Wed, Jan 24, 2024 at 11:02 PM Marten van Kerkwijk 
wrote:

> Stack of matrices in this context is a an ndarray in which the last two
> dimensions are interpreted as columns and rows of matrices (in that
> order), stack of vectors as an ndarray in which the last dimension is
> interpreted as column vectors.  (Well, axes in all these functions can
> be chosen arbitrarily, but those are the defaults.)
>
> So a simple example for matvec would be a rotation matrix that I'd like
> to apply to a large number of vectors (say to points in space); this is
> currently not easy.  Complex vectors might be Fourier components.  (Note
> that I was rather sloppy in calling it multiplication rather than using
> the term vector-matrix product, etc.; it is definitely not element-wise!).
>
> The vector-matrix product comes up a bit less, but as mentioned by
> Evgeni in physics there is, e.g., the bra-ket stuff with Hamiltonians
> (<\psi | \hat H | \psi>), and in linear least squares one often gets
> terms which for real data are written as Xᵀ Z, but for complex would be
> Xᴴ Z [1]
>
> Hope this clarifies things!
>
>

Thanks, but I'm still confused about the need.
Perhaps the following illustrates why.
With respect to the example you offered, what am I missing?
Alan Isaac

import numpy as np
rng = np.random.default_rng()

rot = np.array([[0,-1],[1,0]])#a rotation matrix

print("first type of stack of vectors:")
vecs1 = rng.random((2,10))
print(vecs1.shape==(2,10))
result1 = rot.dot(vecs1)

print("second type of stack of vectors:")
rng = np.random.default_rng(314)
vecs2 = vecs1.T
result2 = rot.dot(vecs2.T)
print(f"same result2? {(result1==result2).all()}")

print("third type of stack of vectors:")
vecs3 = np.reshape(vecs2,(10,2,1))
result3 = rot.dot(vecs3.squeeze().T)
print(f"same result3? {(result1==result3).all()}")

print("fourth type of stack of vectors:")
vecs4 = np.reshape(vecs2,(10,1,2))
result4 = rot.dot(vecs4.squeeze().T)
print(f"same result4? {(result1==result4).all()}")
___
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-archive.com


Re: [Numpy-discussion] : Boolean binary '-' operator

2017-06-27 Thread Alan Isaac

On 6/27/2017 5:35 PM, Nathaniel Smith wrote:

I remember... The major issue here is that some people want dot(a, b) on 
Boolean matrices to use these semantics, right?


Yes; this has worked in the past, and loss of this functionality is unexpected.

That said, I haven't used this outside of a teaching context,
so for me it only affects some course notes.

I suppose loss of this behavior could be somewhat mitigated
if numpy could provide an optimized general inner product
(along the line of the Wolfram Language's `Inner`).  But note
that numpy.linalg.matrix_power is also lost (e.g., the derived
graphs that allow an intuitive representation of transitive closure).

fwiw,
Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Adding a return value to np.random.shuffle

2018-04-12 Thread Alan Isaac

Some people consider that not to be Pythonic:
https://mail.python.org/pipermail/python-dev/2003-October/038855.html

Alan Isaac

On 4/12/2018 1:36 PM, Joseph Fox-Rabinovitz wrote:

Would it break backwards compatibility to add the input as a return value to 
np.random.shuffle? I doubt anyone out there is relying on the None return value.

The change is trivial, and allows shuffling a new array in one line instead of 
two:

     x = np.random.shuffle(np.array(some_junk))

I've implemented the change in PR#10893.



___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] align `choices` and `sample` with Python `random` module

2018-12-09 Thread Alan Isaac

I believe this was proposed in the past to little enthusiasm,
with the response, "you're using a library; learn its functions".

Nevertheless, given the addition of `choices` to the Python
random module in 3.6, it would be nice to have the *same name*
for parallel functionality in numpy.random.

And given the redundancy of numpy.random.sample, it would be
nice to deprecate it with the intent to reintroduce
the name later, better aligned with Python's usage.

Obviously numpy.random.choice exists for both cases,
so this comment is not about functionality.
And I accept that some will think it is not about anything.
Perhaps it might be at least seen as being about this:
using the same function (`choice`) with a boolean argument
(`replace`) to switch between sampling strategies at least
appears to violate the proposal floated at times on this
list that called for two separate functions in apparently
similar cases.  (I am not at all trying to claim that the
argument against flag parameters is definitive; I'm just
mentioning that this viewpoint has already been
promulgated on this list.)

Cheers, Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] align `choices` and `sample` with Python `random` module

2018-12-10 Thread Alan Isaac

On 12/10/2018 11:20 AM, Ralf Gommers wrote:

there is nothing wrong with the current API


Just to be clear: you completely reject the past
cautions on this list against creating APIs
with flag parameters.  Is that correct?

Or is "nothing wrong" just a narrow approval in
this particular case?

Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] adding Quansight Labs as institutional partner

2019-04-09 Thread Alan Isaac

Under the section "How will we fund this?" in the first Quansight link,
there is not category of "individual and institutional donations".
I noticed this because the question recently arose at my university,
how can the university occasionally donate to NumPy development?
In order for this to happen, the recipient of the donation and the
intended use of the funds must be transparently documented.  As an
example, suppose one goes to numpy.org and scrolls down (!?) to
the "Donate to Numpy" button.  It is entirely unclear what that
means, and clicking the button leads to a flipcause site that fails
to clarify.  I suspect many academic institutions would be interested
in making occasional, modest contributions toward NumPy development,
if the recipient and intended uses were entirely transparent.

Cheers, Alan Isaac


On 4/9/2019 3:10 AM, Ralf Gommers wrote:

Hi all,

Last week I joined Quansight. In Quansight Labs I will be working on increasing the contributions to core SciPy/PyData projects, and will also have funded time to work on NumPy and 
other projects myself. Hameer Abbasi has had and will continue to have funded time to work on NumPy as well. So I have submitted a pull request (gh-13289) to add Quansight Labs as 
an Institutional Partner (we list those at https://docs.scipy.org/doc/numpy/dev/governance/people.html#institutional-partners, currently only BIDS).


Both Travis and I wrote blog posts about where we want to go with Quansight 
Labs. Given the relevance to NumPy I thought it would be appropriate to 
reference those posts here:
- https://www.quansight.com/single-post/2019/04/02/Welcoming-Ralf-Gommers-as-Director-of-Quansight-Labs 
<https://www.quansight.com/single-post/2019/04/02/Welcoming-Ralf-Gommers-as-Director-of-Quansight-Labs>

- https://labs.quansight.org/blog/2019/4/joining-labs/

Any feedback, suggestion or idea is very welcome.

Cheers,
Ralf

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] folds and scans

2019-05-12 Thread Alan Isaac

What is the recommended (i.e., fast) way to do
folds and scans across one axis of a NumPy array?
(The equivalent of Mma's Fold and FoldList.)

Assume an arbitrary Python function that
produces one array from two arrays, where these
three arrays share the same dimensions.
(So the use of Python's `reduce` is certainly
conceivable for the fold.)

Thank you,
Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Alan Isaac

Points of reference:
Mathematica: https://reference.wolfram.com/language/ref/Transpose.html
Matlab: https://www.mathworks.com/help/matlab/ref/permute.html

Personally I would find any divergence between a.T and a.transpose()
to be rather surprising.

Cheers, Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-24 Thread Alan Isaac

Iirc, that works only on (2-d) matrices.
Cheers, Alan Isaac


On 6/24/2019 10:45 AM, Todd wrote:

I think the corresponding MATLAB function/operation is this:

https://www.mathworks.com/help/matlab/ref/transpose.html


___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-25 Thread Alan Isaac

I wish this discussion would be clearer that a.T is not going anywhere,
should not change, and in any case should match a.transpose().
Anything else threatens to break existing code for no good payoff.

How many people in this discussion are proposing that a widely used
library like numpy should make a breaking change in syntax just because
someone guesses it won't break too much code "out there"?
I'm having trouble telling if this is an actual view.

Because a.T cannot reasonably change,
if a.H is allowed, it should mean a.conj().transpose().
This also supports the easiest and least buggy transition away from np.matrix.

But since `a.H` would not be a view of `a`, most probably any `a.H`
proposal should be discarded as misleading and not materially better than
the existing syntax (a.conj().T).

I trust nobody is proposing to change `transpose`.

Cheers, Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Syntax Improvement for Array Transpose

2019-06-25 Thread Alan Isaac

On 6/25/2019 11:03 AM, Todd wrote:
Fair enough.  But although there are valid reasons to do a divide by zero, it still causes a warning because it is a problem often enough that people should be made aware of it.  I 
think this is a similar scenario.




I side with Stephan on this, but when there are opinions on both sides,
I wonder what the resolution strategy is.  I suppose there is a possible 
tension:

1. Existing practice should be privileged (no change for the sake of change).
2. Documented user issues need to be addressed.

So what is an "in the wild" example of where numpy users create errors that pass
silently because a 1-d array transpose did not behave as expected?
Why would the unexpected array shape of the result not alert the user if it 
happens?

In your favor, Mathematica's `Transpose` raises an error when applied to 1d 
arrays,
and the Mma designs are usually carefully considered.

Cheers, Alan Isaac


___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] error during pip install

2019-09-27 Thread Alan Isaac

Upgrading numpy with pip on Python 3.8b4 on Win 10 produced:
ERROR: Could not install packages due to an EnvironmentError: [WinError 123] The 
filename, directory name, or volume label syntax is incorrect: '"C:'

However, the install appears to have been successful.

fwiw, Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] error during pip install

2019-09-28 Thread Alan Isaac

On Fri, Sep 27, 2019 at 10:12 AM Alan Isaac wrote:
Upgrading numpy with pip on Python 3.8b4 on Win 10 
produced:
ERROR: Could not install packages due to an 
EnvironmentError: [WinError 123] The filename, 
directory name, or volume label syntax is incorrect: 
'"C:'



However, the install appears to have been successful.



On Fri, Sep 27, 2019 at 5:41 PM Charles R Harris wrote:

I that the pip that comes with Python 3.8b4?


Yes.

On 9/27/2019 7:43 PM, Charles R Harris wrote:
And where did you get NumPy, we don't have any compatible wheels. Was this from source? 



Umm, ... does `pip` automatically compile from source in
this case?  (I just used `python38 -m pip install numpy`;
I'm afraid I did not specify a log file.)

But I'll take the core message to be: wait for the wheels.

Cheers,
Alan

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] error during pip install

2019-09-28 Thread Alan Isaac

On 9/28/2019 12:12 PM, Charles R Harris wrote:
I'm actually pleased that the install succeeded on Window, although you won't have good BLAS/LAPACK, just the numpy C versions of lapack_lite. The warning/error is a bit 
concerning though, it would be nice to know if it is from Python3.8 pip or numpy.



Possibly relevant:
https://github.com/numpy/numpy/issues/11451

Alan
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Re: Add to NumPy a function to compute cumulative sums from 0.

2023-08-22 Thread Alan G. Isaac

`cumsum` provides a sequence of partial sums, exactly as expected.
https://reference.wolfram.com/language/ref/Accumulate.html
https://www.mathworks.com/help/matlab/ref/cumsum.html
https://docs.julialang.org/en/v1/base/arrays/#Base.cumsum
https://hackage.haskell.org/package/base-4.12.0.0/docs/Data-List.html#v:scanl1

`diff` also behaves as expected, and as you expect.
But I do not think that is the question.
The question is, how useful would it be for numpy to have a
less commonly needed and closely related function.
(I have no need of it, and I don't really see a pressing need.)



On 8/22/2023 10:36 AM, john.daw...@camlingroup.com wrote:

For n values there are n-1 differences. Equivalently, for k differences there 
are k+1 values. Herefor, `diff` ought to reduce length by 1 and `cumsum` ought 
to increase it by 1. Returning arrays of the same length is a fencepost error. 
This is a problem in the current behaviour of `cumsum` and the proposed 
behaviour of `diff0`.

___
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-archive.com


Re: [Numpy-discussion] Comment published in Nature Astronomy about The ecological impact of computing with Python

2020-11-24 Thread Alan G. Isaac

On 11/24/2020 2:06 PM, Charles R Harris wrote:

There are still ozone holes over the Antarctic, last time I looked they were 
explained as due to an influx of cold air.


I believe industrial CFC usage, which has fallen since the Montreal Protocol,
is still considered the primary culprit in ozone layer thinning. Is there
a particular model you have in mind? (Ideally one with publicly available
source code and some data.)



On 11/24/2020 2:06 PM, Charles R Harris wrote:

If you want to deal with GHG, push nuclear power.


Yes. However, solar is becoming competitive is some regions
for cost per watt, and avoids the worst waste disposal issues.

fwiw, Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] problem with numpy 1.19.4 install via pip on Win 10

2020-12-02 Thread Alan G. Isaac

numpy 1.19.3 installs fine.
numpy 1.19.4 appears to install but does not work.
(Details below. The supplied tinyurl appears relevant.)
Alan Isaac

PS test> python38 -m pip install -U numpy
Collecting numpy
  Using cached numpy-1.19.4-cp38-cp38-win_amd64.whl (13.0 MB)
Installing collected packages: numpy
Successfully installed numpy-1.19.4
PS test> python38
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
 ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Program Files\Python38\lib\site-packages\numpy\__init__.py", line 305, in 

_win_os_check()
  File "C:\Program Files\Python38\lib\site-packages\numpy\__init__.py", line 
302, in _win_os_check
raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Program Files\\Python38\\lib\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug 
in the windows runtime. See this issue for more information: https://tinyurl.com/y3dm3h86

>>>
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] problem with numpy 1.19.4 install via pip on Win 10

2020-12-03 Thread Alan G. Isaac

"current expectation is that this [fix] will be able to be released near the end of 
January 2021"
!


On 12/2/2020 7:13 PM, Ilhan Polat wrote:
Yes this is known and we are waiting MS to roll out a solution for this. Here are more details 
https://developercommunity2.visualstudio.com/t/fmod-after-an-update-to-windows-2004-is-causing-a/1207405 


___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] NEP 48: Spending NumPy Project funds

2021-02-22 Thread Alan G. Isaac

Yes.

On 2/22/2021 7:08 AM, Pearu Peterson wrote:

it is nobody's business, IMHO, and is likely very hard if not impossible to 
verify

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] two questions about `choose`

2021-04-17 Thread Alan G. Isaac

1. Is there a technical reason for `choose` not accept a `dtype` argument?

2. Separately, mypy is unhappy with my 2nd argument to `choose`:
Argument 2 to "choose" has incompatible type "Tuple[int, Sequence[float]]";
expected "Union[Union[int, float, complex, str, bytes, generic], Sequence[Union[int, 
float, complex, str, bytes, generic]], Sequence[Sequence[Any]],_SupportsArray]"
However, `choose` is happy to have e.g. `choices=(0,seq)` (and I hope it will 
remain so!).

E.g.,
a = a = (0,1,1,0,0,0,1,1)  #binary array
np.choose((0,range(8)) #array([0, 1, 2, 0, 0, 0, 6, 7])

Thanks, Alan Isaac
___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] two questions about `choose`

2021-04-18 Thread Alan G. Isaac

I think you are saying that this current behavior of `choose` should
be considered a bug. I hope not, because as illustrated, it is useful.
How would you propose to efficiently do the same substitutions?


On 4/17/2021 4:27 PM, Kevin Sheppard wrote:
2. I would describe this a a bug. I think sequences are converted to arrays and in this case the conversion is not returning a 2 element object array but 
expanding and then concatenation.



On Sat, Apr 17, 2021, 18:56 Alan G. Isaac mailto:alan.is...@gmail.com>> wrote:



2. Separately, mypy is unhappy with my 2nd argument to `choose`:
Argument 2 to "choose" has incompatible type "Tuple[int, Sequence[float]]";
expected "Union[Union[int, float, complex, str, bytes, generic], 
Sequence[Union[int, float, complex, str, bytes, generic]],
Sequence[Sequence[Any]],_SupportsArray]"
However, `choose` is happy to have e.g. `choices=(0,seq)` (and I hope it 
will remain so!).

E.g.,
a = a = (0,1,1,0,0,0,1,1)  #binary array
np.choose(a, (0,range(8))     #array([0, 1, 2, 0, 0, 0, 6, 7])

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Alan G. Isaac

Is there any thought of allowing for other comparisons?
In which case `last_k` might be preferable.
Alan Isaac

On 5/30/2021 2:38 AM, Ilhan Polat wrote:


I think "max_k" is a good generalization of the regular "max".

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] EHN: Discusions about 'add numpy.topk'

2021-05-30 Thread Alan G. Isaac

Mathematica and Julia both seem relevant here.
Mma has TakeLargest (and Wolfram tends to think hard about names).
https://reference.wolfram.com/language/ref/TakeLargest.html
Julia's closest comparable is perhaps partialsortperm:
https://docs.julialang.org/en/v1/base/sort/#Base.Sort.partialsortperm
Alan Isaac



On 5/30/2021 4:40 AM, kang...@mail.ustc.edu.cn wrote:

Hi, Thanks for reply, I present some details below:

___
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Re: How do I use the numpy on spyder?

2024-10-31 Thread Alan via NumPy-Discussion
Nowadays, free AIs are good for such questions:
https://www.youtube.com/watch?v=bA-tbHwvA6A

hth

On Thu, Oct 31, 2024 at 9:31 AM Joao Pereira via NumPy-Discussion <
numpy-discussion@python.org> wrote:

> I don´t know how to use the numpy on spyder. I have tried to use this
> line: "import numpy as np" but i dont know if it's the only necessary thing
> to do.
> If you could explain it to me I'll appreciate 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/
> Member address: alan.is...@gmail.com
>
___
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-archive.com