id Temperature Humidity Light CO2 HumidityRatio Occupancy
date
2015-02-04 17:51:00 1 2.518315 0.278509 1.573666 0.364926 1.091690 1.0
2015-02-04 17:51:59 2 2.488814 0.277696 1.591637 0.341860 1.080489 1.0
2015-02-04 17:53:00 3 2.488814 0.273628 1.573666 0.340269 1.075822 1.0
2015-02-04 17:54:00 4 2.488814 0.265492 1.573666 0.323567 1.066489 1.0
2015-02-04 17:55:00 5 2.439646 0.265492 1.573666
plt.figure(figsize=(7,6))
corr = df.drop('id', axis=1).corr()
sns.heatmap(corr, cmap=sns.color_palette("RdBu_r", 1000), vmin=-1, center=0, annot=True)
Как видно на графике верх и низ срезаны. Как полностью втиснуть квадратик в график? https://drive.google.com/file/d/1YzGDML_wBZSJTGip3yZ1uk6HTTCSg_nD/view?usp=sharing Как получены данные:
import pandas as pd
df = pd.read_csv('datatraining.txt', sep=r',', engine='python', header=None, names = ['id', 'date','Temperature','Humidity','Light','CO2','HumidityRatio','Occupancy'])
df = df.drop([0])
df.index = pd.to_datetime(df.date)
df.drop('date', axis=1, inplace=True)
df = df.apply(pd.to_numeric)
def scale(df):
return (df - df.mean()) / df.std()
df.Temperature = scale(df.Temperature)
df.Humidity = scale(df.Humidity)
df.Light = scale(df.Light)
df.CO2 = scale(df.CO2)
df.HumidityRatio = scale(df.HumidityRatio)