Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Name and value of col with max corr
- corr_max = 0
- corr_max_col = columns[0]
- # Loop to check all columns contained in list
- for col in columns:
- # Check the correlation of a pair of columns
- corr_val = df.corr('SALESCLOSEPRICE', col)
- # Logic to compare corr_max with current corr_val
- if corr_val > corr_max:
- # Update the column name and corr value
- corr_max = corr_val
- corr_max_col = col
- print(corr_max_col)
Add Comment
Please, Sign In to add comment