Wolfram: Association. Delete Items by Filter
Filter by Key, via List of Keys
KeyTake[asso, listOfKeys]
-
return an association containing only the elements with given keys.
KeyTake[ Association[ a -> 1, b -> 2, c -> 3, d -> 4 ], {a, c} ] (* <|a -> 1, c -> 3|> *)
KeyTake[listOfAssoc, listOfKeys]
-
gives a list of associations.
xx = { Association[ a -> 1, b -> 2, c -> 3, d -> 4 ], Association[ a -> 10, b -> 20, c -> 30, d -> 40 ] }; KeyTake[ xx, {a, c} ] (* {<|a -> 1, c -> 3|>, <|a -> 10, c -> 30|>} *)
Filter by Key, via a Function
Filter by Values, via a Function
Select
-
Select[ asso, f]
→ get items where f return true on the values.Select[ asso, f, n]
→ get first n.
Select[ Association[ a -> 1, b -> 2, c -> 3, d -> 4 ], EvenQ ] (* <|b -> 2, d -> 4|> *)
Wolfram. Association (Key Value List)
- Wolfram: Association (Key Value List)
- Wolfram: Create Association
- Wolfram: Association. Get Value
- Wolfram: Association. Check Key Exist
- Wolfram: Association. Check Value Exist
- Wolfram: Association. Add Item
- Wolfram: Association. Delete Items by Key
- Wolfram: Association. Delete Items by Index
- Wolfram: Association. Delete Items by Filter
- Wolfram: Association. Sort
- Wolfram: Association. Union, Intersection, Complement, Etc
- Wolfram: Map f to Association
- Wolfram: Association to List, Get All Keys or Values
- Wolfram: JSON Import Export