本文整理汇总了Python中pyvttbl.DataFrame.read_tbl方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame.read_tbl方法的具体用法?Python DataFrame.read_tbl怎么用?Python DataFrame.read_tbl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyvttbl.DataFrame
的用法示例。
在下文中一共展示了DataFrame.read_tbl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test01
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test01(self):
"""repr test"""
R = Descriptives([('count', 100.0),
('mean', 11.61),
('mode', 11.0),
('var', 26.947373737373752),
('stdev', 5.191085988246944),
('sem', 0.5191085988246944),
('rms', 12.707084638106414),
('min', 3.0),
('Q1', 7.0),
('median', 11.0),
('Q3', 15.5),
('max', 23.0),
('range', 20.0),
('95ci_lower', 10.592547146303598),
('95ci_upper', 12.6274528536964)],
cname='WORDS')
df = DataFrame()
df.read_tbl('data/words~ageXcondition.csv')
D = eval(repr(df.descriptives('WORDS')))
for k in D.keys():
self.failUnlessAlmostEqual(D[k],R[k])
示例2: test11
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test11(self):
df = DataFrame()
df.read_tbl('data/error~subjectXtimeofdayXcourseXmodel_MISSING.csv')
D = str(df.descriptives('ERROR'))
R = """\
Descriptive Statistics
ERROR
==========================
count 48.000
mean 3.896
mode 3.000
var 5.797
stdev 2.408
sem 0.348
rms 4.567
min 0.000
Q1 2.000
median 3.000
Q3 5.000
max 10.000
range 10.000
95ci_lower 3.215
95ci_upper 4.577 """
self.assertEqual(D, R)
示例3: test0
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test0(self):
df=DataFrame()
df.read_tbl('data/error~subjectXtimeofdayXcourseXmodel_MISSING.csv')
pt = df.pivot('ERROR', ['TIMEOFDAY'],['COURSE'])
self.assertAlmostEqual(3.22222222222,pt[1,0],5)
示例4: test6
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test6(self):
R = DataFrame([('SUBJECT', [1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3]), ('TIMEOFDAY', [u'T1', u'T1', u'T1', u'T2', u'T2', u'T2', u'T2', u'T2', u'T2', u'T1', u'T1', u'T1', u'T2', u'T2', u'T2']), ('COURSE', [u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1', u'C1']), ('MODEL', [u'M1', u'M2', u'M3', u'M1', u'M2', u'M3', u'M1', u'M2', u'M3', u'M1', u'M2', u'M3', u'M1', u'M2', u'M3']), ('ERROR', [10, 8, 6, 5, 4, 3, 4, 3, 3, 8, 7, 4, 4, 1, 2])])
df=DataFrame()
df.read_tbl('data/error~subjectXtimeofdayXcourseXmodel_MISSING.csv')
df2 = df.where([('COURSE','=',['C1']),('TIMEOFDAY','in',["T1", "T2"])])
self.assertEqual(repr(df2),repr(R))
示例5: test_kn
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test_kn(self):
df = DataFrame()
df.read_tbl('data/example.csv')
y = [23]*len(df['X'])
df['X'] = y
self.assertEqual(df.keys(), ['CASE', 'TIME', 'CONDITION', 'X'])
示例6: test02
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test02(self):
df=DataFrame()
df.read_tbl('data/words~ageXcondition.csv')
D = repr(df.histogram('WORDS'))
R = "Histogram([('values', [4.0, 14.0, 17.0, 12.0, 15.0, 10.0, 9.0, 5.0, 6.0, 8.0]), \
('bin_edges', [3, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0, 17.0, 19.0, 21.0, 23])], cname='WORDS')"
self.assertEqual(D, R)
示例7: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test2(self):
R="""\
Chi-Square: Single Factor
SUMMARY
1 2 3 4 5
=====================================================
Observed 7 20 23 9 0
Expected 11.800 11.800 11.800 11.800 11.800
CHI-SQUARE TESTS
Value df P
============================================
Pearson Chi-Square 30.746 4 3.450e-06
Likelihood Ratio -- -- --
Observations 59
POST-HOC POWER
Measure
==============================
Effect size w 0.722
Non-centrality lambda 30.746
Critical Chi-Square 9.488
Power 0.998 """
df = DataFrame()
df.read_tbl('data/chi_test.csv')
X=df.chisquare1way('RESULT',{1:11.8 ,2:11.8 ,3:11.8 ,4:11.8 ,5:11.8})
self.assertEqual(str(X),R)
示例8: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test2(self):
## Between-Subjects test
df=DataFrame()
fname='words~ageXcondition.csv'
df.read_tbl(fname)
aov=Anova()
aov.run(df,'WORDS',bfactors=['AGE','CONDITION'])
示例9: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test1(self):
R = Descriptives([('count', 48.0),
('mean', 3.8958333333333335),
('mode', 3.0),
('var', 5.797429078014184),
('stdev', 2.4077850979716158),
('sem', 0.34753384361617046),
('rms', 4.566636252940086),
('min', 0.0),
('Q1', 2.0),
('median', 3.0),
('Q3', 5.0),
('max', 10.0),
('range', 10.0),
('95ci_lower', 3.2146669998456394),
('95ci_upper', 4.5769996668210275)],
cname='ERROR')
df=DataFrame()
df.read_tbl('data/error~subjectXtimeofdayXcourseXmodel_MISSING.csv')
D=df.descriptives('ERROR')
for k in D.keys():
self.failUnlessAlmostEqual(D[k],R[k])
示例10: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test1(self):
R = {'d': [np.array([ 9, 8, 6, 8, 10, 4, 6, 5, 7, 7,
7, 9, 6, 6, 6, 11, 6, 3, 8, 7,
11, 13, 8, 6, 14, 11, 13, 13, 10, 11,
12, 11, 16, 11, 9, 23, 12, 10, 19, 11,
10, 19, 14, 5, 10, 11, 14, 15, 11, 11]),
np.array([ 8, 6, 4, 6, 7, 6, 5, 7, 9, 7,
10, 7, 8, 10, 4, 7, 10, 6, 7, 7,
14, 11, 18, 14, 13, 22, 17, 16, 12, 11,
20, 16, 16, 15, 18, 16, 20, 22, 14, 19,
21, 19, 17, 15, 22, 16, 22, 22, 18, 21])],
'fname': 'output\\box(WORDS~AGE).png',
'maintitle': 'WORDS by AGE',
'xlabels': [u'AGE = old', u'AGE = young']}
df=DataFrame()
df.TESTMODE=True
df.read_tbl('data/words~ageXcondition.csv')
D=df.box_plot('WORDS',['AGE'], output_dir='output')
self.assertEqual(D['fname'],R['fname'])
self.assertEqual(D['maintitle'],R['maintitle'])
self.assertEqual(D['xlabels'],R['xlabels'])
for d,r in zip(np.array(D['d']).flat,
np.array(R['d']).flat):
self.assertAlmostEqual(d,r)
示例11: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test1(self):
R="""\
Chi-Square: Single Factor
SUMMARY
1 2 3 4
============================================
Observed 7 20 23 9
Expected 14.750 14.750 14.750 14.750
CHI-SQUARE TESTS
Value df P
========================================
Pearson Chi-Square 12.797 3 0.005
Likelihood Ratio 13.288 3 0.004
Observations 59
POST-HOC POWER
Measure
==============================
Effect size w 0.466
Non-centrality lambda 12.797
Critical Chi-Square 7.815
Power 0.865 """
df = DataFrame()
df.read_tbl('data/chi_test.csv')
X=df.chisquare1way('RESULT')
self.assertEqual(str(X),R)
示例12: test0
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test0(self):
R = {'d': [9.0, 8.0, 6.0, 8.0, 10.0, 4.0, 6.0, 5.0, 7.0, 7.0,
7.0, 9.0, 6.0, 6.0, 6.0, 11.0, 6.0, 3.0, 8.0, 7.0,
11.0, 13.0, 8.0, 6.0, 14.0, 11.0, 13.0, 13.0, 10.0,
11.0, 12.0, 11.0, 16.0, 11.0, 9.0, 23.0, 12.0, 10.0,
19.0, 11.0, 10.0, 19.0, 14.0, 5.0, 10.0, 11.0, 14.0,
15.0, 11.0, 11.0, 8.0, 6.0, 4.0, 6.0, 7.0, 6.0, 5.0,
7.0, 9.0, 7.0, 10.0, 7.0, 8.0, 10.0, 4.0, 7.0, 10.0,
6.0, 7.0, 7.0, 14.0, 11.0, 18.0, 14.0, 13.0, 22.0, 17.0,
16.0, 12.0, 11.0, 20.0, 16.0, 16.0, 15.0, 18.0, 16.0,
20.0, 22.0, 14.0, 19.0, 21.0, 19.0, 17.0, 15.0, 22.0,
16.0, 22.0, 22.0, 18.0, 21.0],
'fname': 'output\\box(WORDS).png',
'maintitle': 'WORDS',
'val': 'WORDS'}
df=DataFrame()
df.TESTMODE=True
df.read_tbl('data/words~ageXcondition.csv')
D=df.box_plot('WORDS', output_dir='output')
self.assertEqual(D['fname'],R['fname'])
self.assertEqual(D['maintitle'],R['maintitle'])
self.assertEqual(D['val'],R['val'])
for d,r in zip(np.array(D['d']).flat,
np.array(R['d']).flat):
self.assertAlmostEqual(d,r)
示例13: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test2(self):
df=DataFrame()
df.read_tbl('data/error~subjectXtimeofdayXcourseXmodel_MISSING.csv')
pt = df.pivot('ERROR', ['MODEL','TIMEOFDAY'],['COURSE'],where=['SUBJECT != 1'])
self.assertEqual(repr(eval(repr(pt))), repr(pt))
示例14: test1
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test1(self):
R="""\
t-Test: One Sample for means
SUPPRESSION
=====================================
Sample Mean 19.541
Hypothesized Pop. Mean 17
Variance 228.326
Observations 384
df 383
t Stat 3.295
alpha 0.050
P(T<=t) one-tail 5.384e-04
t Critical one-tail 1.966
P(T<=t) two-tail 0.001
t Critical two-tail 1.649
P(T<=t) two-tail 0.001
Effect size d 0.168
delta 3.295
Observed power one-tail 0.950
Observed power two-tail 0.908 """
df = DataFrame()
df.read_tbl('data/suppression~subjectXgroupXageXcycleXphase.csv')
D=df.ttest('SUPPRESSION', pop_mean=17.)
self.assertEqual(str(D),R)
示例15: test2
# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import read_tbl [as 别名]
def test2(self):
R = DataFrame([('SUBJECT', [1, 2]), ('TIMEOFDAY', [u'T1', u'T1']), ('COURSE', [u'C1', u'C2']), ('MODEL', [u'M1', u'M1']), ('ERROR', [10, 10])])
df=DataFrame()
df.read_tbl('data/error~subjectXtimeofdayXcourseXmodel_MISSING.csv')
df2 = df.where([('ERROR', '=', 10)])
self.assertEqual(repr(df2),repr(df2))