KeyDrop

KeyDrop[assoc,{key1,key2,}]

yields an association from which elements with keys keyi have been dropped.

KeyDrop[{assoc1,assoc2,},keys]

gives a list of associations.

KeyDrop[keys]

represents an operator form of KeyDrop that can be applied to an expression.

Details

  • KeyDrop preserves the original order of elements.
  • Any keyi that does not appear in assoc is ignored.
  • KeyDrop can be applied not only to Association objects, but also to lists of rules.
  • KeyDrop[keys][expr] is equivalent to KeyDrop[expr,keys].

Examples

Basic Examples  (7)

Delete entry with the specified key from association:

Delete entries, given a list of keys:

Delete entries from several associations, given a list of keys:

Delete entries from a list of rules, given a key:

Delete entries from several lists:

Delete from a mixed list of an association and a list of rules:

Use the operator form of KeyDrop:

Wolfram Research (2014), KeyDrop, Wolfram Language function, https://reference.wolfram.com/language/ref/KeyDrop.html.

Text

Wolfram Research (2014), KeyDrop, Wolfram Language function, https://reference.wolfram.com/language/ref/KeyDrop.html.

CMS

Wolfram Language. 2014. "KeyDrop." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/KeyDrop.html.

APA

Wolfram Language. (2014). KeyDrop. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/KeyDrop.html

BibTeX

@misc{reference.wolfram_2024_keydrop, author="Wolfram Research", title="{KeyDrop}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/KeyDrop.html}", note=[Accessed: 25-April-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_keydrop, organization={Wolfram Research}, title={KeyDrop}, year={2014}, url={https://reference.wolfram.com/language/ref/KeyDrop.html}, note=[Accessed: 25-April-2024 ]}