Let G be a finite group, and let \(\pi \) be a set of prime numbers. In this paper, we introduce an invertible integer matrix \(C_{\pi }\) which depends on the pair \((G,\pi )\) . This matrix generalizes the Cartan matrix of G for a prime p. We prove that for a nilpotent group G, the largest elementary divisor of \(C_{\pi }\) is equal to the \(\pi \) -part \(|G|_{\pi }\) of |G|. Furthermore, we consider a matrix \(W_{\pi }(G)\) obtained by restricting the character table of G to \(G_{\pi '}\) and then rationalizing it. Then we prove that for any finite group G, the largest elementary divisor of \(W_{\pi }(G)\) is equal to the \(\pi '\) -part \(|G|_{\pi '}\) of |G|.