Physics, Data Science, Least Squares, Chemometrics, Spectroscopy.
numpy.linalg import inv The least squares formula to obtain the concentration of pure substances in the unknown mixture is defined as: def least_sq(sample_spectrum, components): # sample_spectrum (unknown spectrum): array of w values. # components (known spectra): array of n (number of components)