1

I used corrpython's method to view the correlation matrix of my dataset.Considering that it was too big,I could not see it all at a time,I had to scroll left and right to see it.So,I tried to save it as an image but it failed giving me this error

'DataFrame' object has no attribute 'savefig'

This is the code I wrote :

path_to_file = "C:\\Users\\hmk\\Desktop\\Final.csv"
data = pd.read_csv(path_to_file)
corr = data.corr()
corr.style.background_gradient(cmap='coolwarm')
corr.savefig('result.png', bbox_inches='tight', pad_inches=0.0)
mamadou
  • 135
  • 2
  • 13

0 Answers0