Difference between revisions of "Array.bykey()"
(Created page with "* << Z3 Home * Z3 Language Documentation * Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member F...") |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 32: | Line 32: | ||
etc | etc | ||
| + | a=MS(4); | ||
| + | a=a.concat([8,3,4,5]); | ||
| + | a.bykey(1); | ||
| + | |||
| + | {"3": [ | ||
| + | [ | ||
| + | 13, | ||
| + | 3, | ||
| + | 2, | ||
| + | 16 | ||
| + | ], | ||
| + | [ | ||
| + | 8, | ||
| + | 3, | ||
| + | 4, | ||
| + | 5 | ||
| + | ] | ||
| + | ], | ||
| + | "6": [ | ||
| + | [ | ||
| + | 12, | ||
| + | 6, | ||
| + | 7, | ||
| + | 9 | ||
| + | ] | ||
| + | ], | ||
| + | "10": [ | ||
| + | [ | ||
| + | 8, | ||
| + | 10, | ||
| + | 11, | ||
| + | 5 | ||
| + | ] | ||
| + | ], | ||
| + | "15": [ | ||
| + | [ | ||
| + | 1, | ||
| + | 15, | ||
| + | 14, | ||
| + | 4 | ||
| + | ] | ||
| + | ] | ||
| + | } | ||
==See Also== | ==See Also== | ||
Latest revision as of 03:38, 16 April 2020
bykey
Create an object with elements of array bucketed with the key specified.
Example
a=#TABLE1;
a.bykey(0)
{ "Amino Acid": [ [ "Amino Acid", "Symbol", "SLC", "DNA codons" ] ], "Isoleucine ": [ [ "Isoleucine ", "Ile", "I", "ATT, ATC, ATA" ] ],
etc a=MS(4); a=a.concat([8,3,4,5]); a.bykey(1);
{"3": [ [ 13, 3, 2, 16 ], [ 8, 3, 4, 5 ] ], "6": [ [ 12, 6, 7, 9 ] ], "10": [ [ 8, 10, 11, 5 ] ], "15": [ [ 1, 15, 14, 4 ] ] }