# variância dos centroides para cada um dos atributos
len_centroids = len(centroids[0])
dict_variancias = {df.columns[i]: centroids[:, i].var().round(4) for i in range(len_centroids)}
for key, value in dict_variancias.items():
print(f'{key}: {value}')
print('-'*40)
# maiores variâncias (>= 0.01)
for key, value in dict_variancias.items():
if value >= 0.01:
print(f'{key}: {value}')
Out:
BALANCE: 0.0224
PURCHASES: 0.0196
CASH_ADVANCE: 0.0226
CREDIT_LIMIT: 0.036
PAYMENTS: 0.028
MINIMUM_PAYMENTS: 0.0541