df = pd.DataFrame({'one': [0.1, 0.32, 0.2, 0.4, 0.8], 'two': [0.23, 0.18, 
    0.56, 0.61, 0.12], 'three': [0.9, 0.3, 0.6, 0.5, 0.3], 'four': [0.34, 
    0.75, 0.91, 0.19, 0.21], 'zive': [0.1, 0.32, 0.2, 0.4, 0.8], 'six': [
    0.9, 0.3, 0.6, 0.5, 0.3], 'drive': [0.9, 0.3, 0.6, 0.5, 0.3]})
corrMatrix = df.corr()
corrMatrix.loc[:, :] = np.tril(corrMatrix, k=-1)
already_in = set()
result = []
for col in corrMatrix:
    perfect_corr = corrMatrix[col][corrMatrix[col] == 1].index.tolist()
if perfect_corr and col not in already_in:
    already_in.update(set(perfect_corr))
perfect_corr.append(col)
result.append(perfect_corr)
Returning groups of correlated columns in pandas data frame