- qspec. unit_vector ( indexes , dim , axis=-1 , dtype=float )[source]
-
Unit vectors with a 1 at the specified indexes.
- Parameters:
-
- indexesarray_like
The indexes of the vector components that are 1.
- dimint_like
The dimension of the unit vectors.
- axisint_like
The axis with the dimension
dim.- dtypetype
The data type of the unit vectors.
- Returns:
-
- endarray
Unit vectors with 1 at the specified
indexesand dimensiondimalong the specifiedaxis.