I have below code from this - 2nd answer
import pandas as pd
import numpy as np
rs = np.random.RandomState(0)
df = pd.DataFrame(rs.rand(10, 10))
corr = df.corr()
corr.style.background_gradient(cmap='coolwarm')
it prints this. How can i rotate column names by 90 degrees in the below image?
Update 1
I updated code as below but it didnt help
import pandas as pd import numpy as np
rs = np.random.RandomState(0)
df = pd.DataFrame(rs.rand(10, 10))
corr = df.corr()
corr.style.set_table_styles(
[dict(selector="th",props=[('max-width', '80px')]),
dict(selector="corr.col_heading",
props=[("writing-mode", "vertical-rl"),
('transform', 'rotateZ(-90deg)'),
])])
corr.style.background_gradient(cmap='coolwarm')