traveler.core.array_tools.dict_to_vector#
- traveler.core.array_tools.dict_to_vector(d, keys=None)[source]#
Convert a dictionary to a vector.
- Parameters:
d (dict) – A dictionary to convert into a vector.
keys (tuple[str, ...] | None, optional) – A tuple that defines the order of keys to use for the vector. The keys must match the dictionary keys. If None, the keys will be inferred from the dictionary and sorted.
- Returns:
A vector representation of the dictionary.
- Return type:
jax.numpy.ndarray