最近搜索
暂无搜索记录
热搜
JAVA
大数据
分布式
Python
人工智能
爬虫
WEB
JavaScript
认证
绘制热力图的时候,只有第一行显示数据,其余行无法显示,不知道是否是seabron和matplotlib的版本问题导致的
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats
import warnings
warnings.filterwarnings("ignore") # 忽略警告
train_data = pd.read_csv("./zhengqi_train.txt",sep = '\t')
test_data = pd.read_csv("./zhengqi_test.txt",sep = '\t');
drop_col_kde = ["V5","V17","V28","V11","V9"]
train_data_drop = train_data.drop(drop_col_kde,axis =1)
# corr方法查看数据之间的相关性
train_corr = train_data_drop.corr()
ax = plt.subplots(figsize = (20,16))
# 绘制热力图,annot=True 显示系数
ax = sns.heatmap(train_corr,vmax = .8,square = True,annot = True,annot_kws={'fontsize': 8})