本文整理汇总了Python中pyvttbl.DataFrame.correlation方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame.correlation方法的具体用法?Python DataFrame.correlation怎么用?Python DataFrame.correlation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvttbl.DataFrame
的用法示例。
在下文中一共展示了DataFrame.correlation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import correlation [as 别名]
def test1(self):
R="""Bivariate Correlations
A B C
======================================================
A spearman 1 0.958 -0.924
Sig (2-tailed) . 9.699e-12 2.259e-09
N 21 21 21
------------------------------------------------------
B spearman 0.958 1 -0.890
Sig (2-tailed) 9.699e-12 . 0.000
N 21 21 21
------------------------------------------------------
C spearman -0.924 -0.890 1
Sig (2-tailed) 2.259e-09 0.000 .
N 21 21 21
Larzelere and Mulaik Significance Testing
Pair i Correlation P alpha/(k-i+1) Sig.
============================================================
A vs. B 1 0.958 9.699e-12 0.017 **
A vs. C 2 0.924 2.259e-09 0.025 **
B vs. C 3 0.890 6.850e-08 0.050 ** """
df=DataFrame()
df['A']=[24,61,59,46,43,44,52,43,58,67,62,57,71,49,54,43,53,57,49,56,33]
df['B']=[42.93472681237495, 78.87307334936268, 75.37292628918023, 65.49076317291956, 55.55965179772366, 56.777730638998236, 62.19451880792437, 54.73710611356715, 72.10021832823149, 85.94377749485642, 78.2087578930983, 72.01681829338037, 84.27889316830063, 60.20516982367225, 65.6276497088971, 62.36549856901088, 69.18772114281175, 67.00548667483324, 59.042687027269466, 71.99214593063917, 45.00831155783992]
df['C']=[-53.05540625388731, -96.33996451998567, -92.32465861908086, -70.90536432779966, -55.953777697739255, -74.12814626217357, -75.89188834814621, -64.24093256012688, -89.62208010083313, -87.41075066046812, -80.40932820298143, -77.99906284144805, -95.31607277596169, -61.672429800914486, -85.26088499198657, -63.4402296673869, -74.84950736563589, -85.00433219746624, -71.5901436929124, -76.43243666219388, -48.01082320924727]
cor=df.correlation(['A','B','C'],coefficient='spearman')
self.assertEqual(str(cor),R)
示例2: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import correlation [as 别名]
def test2(self):
df = DataFrame()
df.read_tbl('iqbrainsize.txt', delimiter='\t')
cor = df.correlation(df.names())
print(cor)
示例3: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import correlation [as 别名]
def test2(self):
df = DataFrame()
df.read_tbl('data/iqbrainsize.txt', delimiter='\t')
cor = df.correlation(df.keys())