yasa.hypno_int_to_str

yasa.hypno_int_to_str(hypno, mapping_dict={-1: 'Art', 0: 'W', 1: 'N1', 2: 'N2', 3: 'N3', 4: 'R'})[source]

Convert an integer hypnogram array to a string array.

[0, 2, 2, 3, 4] ==> [‘W’, ‘N2’, ‘N2’, ‘N3’, ‘R’]

New in version 0.1.5.

Parameters
hypnoarray_like

The sleep staging (hypnogram) 1D array.

mapping_dictdict

The mapping dictionnary. Note that this function is essentially a wrapper around pandas.Series.map().

Returns
hypnoarray_like

The corresponding integer hypnogram.