qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. list_to_dict  (  values ,  keys=None  )[source]

Combine a list of values and a list of keys into a dictionary.

Parameters:
valuesarray_like

The values of the dictionary.

keysarray_like | None

The keys of the dictionary. If omitted, the keys will be the indices of the values.

Returns:
adict

A dictionary with the given values and keys.