Logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2025 Patrick Müller. All rights reserved.

qspec.make_str_iterable_unique  (  a identifier = None  )[source]

Parameters:
aIterable[str]

An Iterable of str values.

identifierIterable[str]

An Iterable of str values to append to the values of 'a' if they appear more than once. If None, '_i' is used as the identifier for the ith appearance of a value in 'a'.

Returns:
outNone

'a', but the elements which appear more than once are numerated/attached with the identifiers and bunched. For example: ['a', 'b', 'c', 'b', 'd'] -> ['a', 'b_0', 'b_1', 'c', 'd'] or ['a', 'b', 'c', 'b', 'd'] -> ['a', 'b' + identifier[0], 'b' + identifier[1], 'c', 'd'].

API navigation