BUILT-IN WOLFRAM LANGUAGE SYMBOL

KeyDrop

KeyDrop[assoc,{key1,key2,}]
yields an association from which elements with keys 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.

DetailsDetails

  • KeyDrop preserves the original order of elements.
  • Any 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].

ExamplesExamplesopen allclose all

Basic Examples  (7)Basic Examples  (7)

Delete entry with the specified key from association:

In[1]:=
Click for copyable input
Out[1]=

Delete entries, given a list of keys:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

Delete entries from several lists:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

Use the operator form of KeyDrop:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)