Values

Values[key1val1,key2val2,]

gives a list of the values vali in an association.

Values[{key1val1,key2val2,}]

gives a list of the vali in a list of rules.

Values[expr,h]

gives a list of values in expr, wrapping each of them with head h before evaluation.

Details

  • Values maintains the order of values.
  • Values[key->val] gives val.
  • Use Values[expr,Hold] to extract values without letting them evaluate.

Examples

open allclose all

Basic Examples  (4)

Get the values in an association:

Get values from a list of rules:

Values automatically threads over lists:

Wrap values with Hold to prevent evaluation:

Properties & Relations  (3)

Values are listed in the order of their appearance:

Values automatically threads over lists, but not associations:

Values returns values of a TimeSeries input:

Possible Issues  (1)

For some special cases such as Nothing and Splice, Values may return a list of unequal length to Keys:

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

Text

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

CMS

Wolfram Language. 2014. "Values." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Values.html.

APA

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

BibTeX

@misc{reference.wolfram_2024_values, author="Wolfram Research", title="{Values}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Values.html}", note=[Accessed: 21-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_values, organization={Wolfram Research}, title={Values}, year={2019}, url={https://reference.wolfram.com/language/ref/Values.html}, note=[Accessed: 21-November-2024 ]}