全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 LATEX论坛
1794 1
2019-06-01

本帖隐藏的内容

When working with data it is helpful to build a correlation matrix to describe data and the associations between variables. In this article, you learn how to use visualizations for correlation matrices in Python.

Read packages into R library

First we need to read the packages into the Python library:

复制代码

Visualizations for correlation matrix

First let us make a correlation matrix table:

复制代码

The above table is quite hard to read and you end up with a lot of correlation numbers that is hard to interpret. Let us make them into a correlation matrix visualization:

复制代码

The above coding gives us the following correlation matrix visualization:

It is possible to limit the digits with the following code:

复制代码

The above coding gives us the following correlation matrix visualization:

It is also possible not to display digits:

复制代码

The above coding gives us the following correlation matrix visualization:

It is also possible to use another colormap:

复制代码

The above coding gives us the following correlation matrix visualization:

And also to highlight numbers:

复制代码

The above coding gives us the following correlation matrix visualization:

It is also possible to highlight large numbers and color negative number red with the following code:

复制代码

The above coding gives us the following correlation matrix:



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2021-8-19 19:17:45
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群