From 2afb23928e1984d475cc460e1672e8f6fa0e4dbe Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 11 Aug 2021 17:21:31 -0400 Subject: Allow clicking on header to get fragment link --- docs/doc/pick.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/pick.html') diff --git a/docs/doc/pick.html b/docs/doc/pick.html index 76f9bfe9..d3166012 100644 --- a/docs/doc/pick.html +++ b/docs/doc/pick.html @@ -4,11 +4,11 @@ BQN: Pick -

Pick

+

Pick

Pick (โŠ‘) chooses elements from ๐•ฉ based on index lists from ๐•จ. ๐•จ can be a plain list, or even one number if ๐•ฉ is a list, in order to get one element from ๐•ฉ. It can also be an array of index lists, or have deeper array structure: each index list will be replaced with the element of ๐•ฉ at that index, effectively applying to ๐•จ at depth 1.

With no ๐•จ, monadic โŠ‘๐•ฉ takes the first element of ๐•ฉ in index order, with an error if ๐•ฉ is empty.

While sometimes "scatter-point" indexing is necessary, using Pick to select multiple elements from ๐•ฉ is less array-oriented than Select (โŠ), and probably slower. Consider rearranging your data so that you can select along axes instead of picking out elements.

-

One element

+

One element

When the left argument is a number, Pick gets an element from a list:

โ†—๏ธ
    2 โŠ‘ 0โ€ฟ1โ€ฟ2โ€ฟ3โ€ฟ4
 2
@@ -46,7 +46,7 @@
     โŸจโŸฉ โŠ‘ 'a'
 'a'
 
-

First

+

First

With no left argument, โŠ‘ is called First, and performs a slight generalization of Pick with a default left argument 0ยจโ‰ข๐•ฉ. For a non-empty array it returns the first element in index order.

โ†—๏ธ
    โŠ‘ <'a'
 'a'
@@ -69,7 +69,7 @@ ERROR
     โŠขยด "last"
 't'
 
-

Many elements

+

Many elements

Pick also accepts a list of indices:

โ†—๏ธ
    a  # Defined above
 โ”Œโ”€       
-- 
cgit v1.2.3