spectrochempy.identity
- identity(n, dtype=None, **kwargs)[source]
- Return the identity - NDDatasetof a given shape.- The identity array is a square array with ones on the main diagonal. - Parameters:
- n (int) – Number of rows (and columns) in - nx- noutput.
- dtype (data-type, optional) – Data-type of the output. Defaults to - float.
- **kwargs – Other parameters to be passed to the object constructor (units, coordset, mask …). 
 
- Returns:
- identity – - nx- narray with its main diagonal set to one, and all other elements 0.
 - See also - Examples - >>> scp.identity(3).data array([[ 1, 0, 0], [ 0, 1, 0], [ 0, 0, 1]])