For a system with two possible states $|e\rangle$ and $|g\rangle$, some sources refer to the Pauli matrices as,
$$ \sigma_z = |e\rangle\langle e| - |g\rangle\langle g|\\ \sigma_x = |e\rangle\langle g| + |g\rangle\langle e|\\ \sigma_y = -i|e\rangle\langle g| + i|g\rangle\langle e| $$
Some sources present the Pauli matrices (without explicitly specifying the basis set) as,
$$ \sigma_z = \left(\begin{array}{cc}1&0\\0&-1\end{array}\right)\\ \sigma_x = \left(\begin{array}{cc}0&1\\1&0\end{array}\right)\\ \sigma_y = \left(\begin{array}{cc}0&-i\\i&0\end{array}\right) $$
I observed that the two equation sets above tally for the basis set:
$$ |e\rangle = \left(\begin{array}{cc}1\\0\end{array}\right)\\ |g\rangle = \left(\begin{array}{cc}0\\1\end{array}\right) $$
I would highly appreciate it if you could shed some light on the generic/basis independent form of the Pauli matrices. What form of Pauli matrices should I use for the following basis set?
$$ |e\rangle = \left(\begin{array}{cc}0\\1\end{array}\right)\\ |g\rangle = \left(\begin{array}{cc}1\\0\end{array}\right) $$