官术网_书友最值得收藏!

Correlation

Correlation is one of the most common statistics and is directly built into the pandas DataFrame. A correlation is a single number that describes the degree of relationship between two variables, and specifically between two sequences of observations of those variables.

A common example of using a correlation is to determine how closely the prices of two stocks follows each other as time progresses. If the changes move closely, the two stocks have a high correlation, and if there is no discernible pattern they are uncorrelated. This is valuable information that can be used in a number of investment strategies.

The level of correlation of two stocks can also vary slightly with the time frame of the entire dataset, as well as the interval. Fortunately, pandas has powerful capabilities for us to easily change these parameters and rerun correlations. We will look at correlations in several places later in the book.

主站蜘蛛池模板: 平顺县| 巢湖市| 睢宁县| 四平市| 普格县| 赣州市| 加查县| 土默特右旗| 和硕县| 微山县| 柞水县| 科技| 淮北市| 镇赉县| 辽阳市| 九江县| 华容县| 滨州市| 汝城县| 金乡县| 北票市| 固镇县| 隆子县| 梁平县| 江津市| 醴陵市| 通道| 凤庆县| 济宁市| 三河市| 秦安县| 临沧市| 洞头县| 布尔津县| 泽州县| 镇坪县| 吉首市| 通榆县| 嵩明县| 原平市| 从化市|