我有一个由274,170 rows and 15 columns组成的Pandas DataFrame。它们都是numerical columns。我对使用Seaborn's Pairplot查看他们的distribution and correlation很感兴趣。在15列中,我希望看到9列。
这是我的尝试:
plt.figure(figsize=(20,15))
g = sns.pairplot(df,
palette="husl",
vars=["age", "amount", "dir", "type",
"reg", "per", "reason",
"deal", "policy", "request"])这要花很长时间!请问是什么问题。我可以做什么来使用Seaborn Pairplot,因为这是我所期待的Data visualization类型,以便正确地理解我的数据。
谢谢
发布于 2020-03-12 21:03:50
海路配对图非常耗费资源,特别是有很多列和行的时候。对于大量的行,我建议绘制数据的一小部分(帧),以获得数据的相当好的指示。
n = 274_170
frac = 0.10
df = pd.DataFrame(np.random.rand(n, 10),
columns = ["age", "amount", "dir", "type", "reg", "per", "reason", "deal", "policy", "request"])
plt.figure(figsize=(20,15))
sns.pairplot(df.sample(frac=frac), palette="husl", vars=["age", "amount", "dir", "type", "reg", "per", "reason", "deal", "policy", "request"])
plt.show()https://stackoverflow.com/questions/60651992
复制相似问题