Mastering Array Selection and Indexing in Data Processing
Unlock the power of array selection and indexing techniques through a series of educational slides. Explore different methods for selecting elements from arrays and dive into various indexing strategies, suitable for beginners and experienced professionals alike. Gain insights into cell structures, subarrays, and major elements within 3D arrays, along with practical examples showcasing efficient indexing practices in data manipulation.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
1 Selecting from Arrays Richard Park (16/04/2020)
2 What? Indexing? Pfffft
3 Selecting from Arrays: Audience Mainly beginners Experienced APLers also
4 Simple Choose Reach The rank operator Sane Select Choose Cells
5 Simple Choose Reach Indexed assignment A 'YEAST' A[3 4] 'E' Modified assignment A 1 9 A[1]+ 5 Optimised
8 Cells, subarrays and elements 3D Array Major cell: Matrix Dimensions / Axes A 2 3 4 A A 2 3 4 A A 2 3 4 A A 2 3 4 A A 2 3 4 A M N O P A A B B C C D D Q R S T E E F F G G H H U V W X I I J J K K L L
9 Cells, subarrays and elements 3D Array Major cell: Matrix 1-cell:Vector A 2 3 4 A M N O P A B C D Q R S T E F G H U V W X I J K L
10 Cells, subarrays and elements 3D Array Major cell: Matrix 1-cell:Vector 0-cell: Scalar A 2 3 4 A M N O P A B C D Q R S T E F G H U V W X I J K L
11 Simple indexing A 2 3 4 A A[1;;] ABCD EFGH IJKL A B C D E F G H I J K L
12 Simple indexing A 2 3 4 A 1 A ABCD EFGH IJKL A B C D E F G H I J K L
13 Simple indexing A 2 3 4 A A[1;2;] EFGH E F G H
14 Simple indexing A 2 3 4 A 1 2 A EFGH E F G H
15 Simple indexing A 2 3 4 A A[1;2;3] G G
16 Simple indexing A 2 3 4 A 1 2 3 A G G
19 Simple indexing A 2 3 4 A A[1 2;2 3;3 4] (1 2)(2 3)(3 4) A GH KL ST WX M N O P A B C D Q R S T E F G H U V W X I J K L
20 Simple indexing A 2 3 4 A A[1 2;1 3;1 4] (1 2)(1 3)(1 4) A AD IL MP UX M N O P A B C D Q R S T E F G H U V W X I J K L
21 Simple indexing A 2 3 4 A ABCD EFGH IJKL MNOP QRST UVWX A[1 2;1 3;1 4] (1 2)(1 3)(1 4) A AD IL MP UX
25 Choose indexing A 2 3 4 A ABCD EFGH IJKL MNOP QRST UVWX A[(1 1 1)(2 1 4)(1 3 4)] APL
26 Choose indexing A 2 3 4 A ABCD EFGH IJKL MNOP QRST UVWX A[(1 1 1)(2 1 4)(1 3 4)] APL
27 Reach indexing nest 2 2 2 (2 2 'DYAL') 1 2 3 (2 2 'ABCD') ('AE' 'IO' 'U') 'NT' 4 DY 1 AL 2 3 AB CD AE IO U NT 4
28 Reach indexing nest[ 2 1 2] AE IO U 2 1 2 2 1 2 nest DY 1 AL 2 3 AB CD AE IO U NT 4
29 Reach indexing nest[ (2 1 2)2] IO (2 1 2)2 2 1 2 2 nest DY 1 AL 2 3 AB CD AE IO U NT 4
30 Reach indexing nest[ (2 1 2)2(2)] nest DY 1 AL 2 3 AB CD AE IO U NT 4 O (2 1 2)2(2) 2 1 2 2 2
31 Reach indexing nest DY 1 AL 2 3 AB CD AE IO U NT 4 DOMAIN ERROR ( (2 1 2)2(2)) nest (2 1 2)2(2) 2 1 2 2 2
32 Pick Reach indexing ((2 1 2))2(2) nest nest DY 1 AL 2 3 AB CD AE IO U NT 4 O (2 1 2)2(2) 2 1 2 2 2
33 Pick Reach indexing 'this' 'that' 'the other thing' this that theother thing 3 'this' 'that' 'the other thing' the other thing
34 Simple Subarrays Choose 0-cells AKA Scalars Reach Nested arrays
35 Squad Indexing as a function you can use operators A 2 3 4 A ABCD EFGH IJKL MNOP QRST UVWX 2 2 A 2 [2]A EFGH QRST
37 Squad with axis [] A 2 3 4 A 2 [1]A MNOP QRST UVWX M N O P A B C D Q R S T E F G H U V W X I J K L
38 Squad with rank A 2 3 4 A 2 3 A MNOP QRST UVWX M N O P A B C D Q R S T E F G H U V W X I J K L
39 Squad with axis [] A 2 3 4 A 2 [2]A EFGH QRST M N O P A B C D Q R S T E F G H U V W X I J K L
40 Squad with rank A 2 3 4 A 2 2 A EFGH QRST M N O P A B C D Q R S T E F G H U V W X I J K L
41 Squad with rank A 2 3 4 A 2 2 A EFGH QRST M N O P A B C D Q R S T E F G H U V W X I J K L
42 Squad with axis [] A 2 3 4 A 2 [3]A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
43 Squad with rank A 2 3 4 A 2 1 A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
44 Squad with rank A 2 3 4 A 2 1 A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
45 Squad with rank A 2 3 4 A 2 1 A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
46 Squad with rank A 2 3 4 A 2 1 A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
47 Squad with rank A 2 3 4 A 2 1 A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
48 Squad with rank A 2 3 4 A 2 1 A BFJ NRV M N O P A B C D Q R S T E F G H U V W X I J K L
51 Squad with rank n 3 5 15 1 3 4 0 2 n 1 6 11 2 7 12 3 8 13 4 9 14 5 10 15 1 6 11 3 8 13 4 9 14
52 Squad with rank n 3 5 15 1 3 4 0 99 n 1 6 11 2 7 12 3 8 13 4 9 14 5 10 15 1 6 11 3 8 13 4 9 14
53 "Sane" indexing I 0 99 n 3 5 15 ( 1 3 4) n "Insane" 1 6 11 3 8 13 4 9 14 1 6 11 2 7 12 3 8 13 4 9 14 5 10 15 1 3 4 I n 1 6 11 3 8 13 4 9 14
54 "Sane" indexing I 0 99 n 3 5 15 1 3 4 I n 1 6 11 3 8 13 4 9 14 1 0 1 1 0 n 1 6 11 3 8 13 4 9 14 1 6 11 2 7 12 3 8 13 4 9 14 5 10 15
55 "Sane" indexing 'APPLE'[1 3 4] Intuitive, beginner friendly APL 1 0 1 1 0/'APPLE' Booleans APL
56 "Sane" indexing 1 3 4 I 'APPLE' Sane APL 1 0 1 1 0 'APPLE' Rank polymorphic APL
57 The Indexer AKA Select I (( ) ) 0 99
58 The Indexer AKA Select I (( ) ) 0 99 1 I A 1 A A[1;;] 1 0 99 A ABCD EFGH IJKL
59 The Indexer AKA Select I (( ) ) 0 99 A 2 3 4 A ABCD EFGH IJKL MNOP QRST UVWX (1 2)(2 3) I A EFGH UVWX A[(1 2, 2 3) ., 4] EFGH UVWX
60 The Indexer AKA Select I (( ) ) 0 99 A 2 3 4 A ABCD EFGH IJKL MNOP QRST UVWX (1 2 4)(2 3) I A H UVWX