My doubt arises from page 99, 101 of the book Quantum Computation and Quantum Information by Michael A.Nielson and Issac L.Chung.
Let {${p_{i}, | \psi_{i} \rangle }$} be an ensemble of pure states.
The density operator for this system can be defined by the equation:
$$\rho = \sum_{i} p_{i} |\psi_{i} \rangle \langle \psi_{i} |$$
On page 101, the author expressed the definition for a density operator like
$$\rho = \sum_{i} \lambda_{i} |\psi_{i} \rangle \langle \psi_{i} |$$
where $\lambda_{i}$ are the eigenvalues of the eigenstate $|\psi_{i} \rangle$.
The only relevant knowledge I do have on hand is the fact that the square of eigenvalue $\lambda_{i}$ yields the probability $p_{i} = |\lambda_{i}|^{2}$ that the measurement outcome of an eigenstate $|\psi_{i} \rangle$ is $\lambda_{i}$. Can someone shed some light on this please?