Skip to main content

Dictionary.from_keys_and_values

Dictionary.from_keys_and_valueskeysvalueserror_on_duplicates

Group: Constants
Aliases: dictionary, lookup table

Documentation

Builds a dictionary from two Vectors. The first vector contains the keys, and the second vector contains the values. The two vectors must be of the same length.

Arguments

  • keys: A vector of keys.
  • values: A vector of values.
  • error_on_duplicates: A flag which specifies if duplicate keys on the input vector should result in an error. By default, set to True, meaning that if two entries in the vector share the same key, an Illegal_Argument error is raised. If set to False, the last entry with a given key will be kept.