Mastering Array Selection and Indexing in Data Processing

Slide Note
Embed
Share

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.


Uploaded on Sep 19, 2024 | 1 Views


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. 1 Selecting from Arrays Richard Park (16/04/2020)

  2. 2 What? Indexing? Pfffft

  3. 3 Selecting from Arrays: Audience Mainly beginners Experienced APLers also

  4. 4 Simple Choose Reach The rank operator Sane Select Choose Cells

  5. 5 Simple Choose Reach Indexed assignment A 'YEAST' A[3 4] 'E' Modified assignment A 1 9 A[1]+ 5 Optimised

  6. 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

  7. 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

  8. 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

  9. 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

  10. 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

  11. 13 Simple indexing A 2 3 4 A A[1;2;] EFGH E F G H

  12. 14 Simple indexing A 2 3 4 A 1 2 A EFGH E F G H

  13. 15 Simple indexing A 2 3 4 A A[1;2;3] G G

  14. 16 Simple indexing A 2 3 4 A 1 2 3 A G G

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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

  22. 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

  23. 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

  24. 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

  25. 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

  26. 33 Pick Reach indexing 'this' 'that' 'the other thing' this that theother thing 3 'this' 'that' 'the other thing' the other thing

  27. 34 Simple Subarrays Choose 0-cells AKA Scalars Reach Nested arrays

  28. 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

  29. 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

  30. 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

  31. 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

  32. 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

  33. 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

  34. 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

  35. 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

  36. 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

  37. 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

  38. 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

  39. 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

  40. 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

  41. 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

  42. 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

  43. 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

  44. 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

  45. 55 "Sane" indexing 'APPLE'[1 3 4] Intuitive, beginner friendly APL 1 0 1 1 0/'APPLE' Booleans APL

  46. 56 "Sane" indexing 1 3 4 I 'APPLE' Sane APL 1 0 1 1 0 'APPLE' Rank polymorphic APL

  47. 57 The Indexer AKA Select I (( ) ) 0 99

  48. 58 The Indexer AKA Select I (( ) ) 0 99 1 I A 1 A A[1;;] 1 0 99 A ABCD EFGH IJKL

  49. 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

  50. 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

Related


More Related Content