コード例 #1
0
    def test_relfreq(self):
        "Testing relfreq"

        data = [self.L, self.LF, self.A, self.AF]
        results1 = ([
            0.10000000000000001, 0.10000000000000001, 0.10000000000000001,
            0.10000000000000001, 0.10000000000000001, 0.10000000000000001,
            0.10000000000000001, 0.10000000000000001, 0.10000000000000001,
            0.10000000000000001
        ], -0.045000050000000069, 2.0900001000000001, 0)
        results2 = ([
            0.10000000000000001, 0.10000000000000001, 0.10000000000000001,
            0.10000000000000001, 0.10000000000000001, 0.10000000000000001,
            0.10000000000000001, 0.10000000000000001, 0.10000000000000001,
            0.10000000000000001
        ], -0.045000050000000069, 2.0900001000000001, 0)
        results3 = (num_array(
            [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
             0.1]), -0.045000050000000069, 2.0900001000000001, 0)
        results4 = (num_array(
            [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
             0.1]), -0.045000050000000069, 2.0900001000000001, 0)

        i = 0
        for d in data:
            self.assertEqual(stats.relfreq(d)[i], results1[i])
            i += 1
コード例 #2
0
 def test_relfreq(self):
     "Testing relfreq"
     
     data = [ self.L, self.LF, self.A, self.AF ]
     results1 = ([0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001], -0.045000050000000069, 2.0900001000000001, 0)
     results2 = ([0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001, 0.10000000000000001], -0.045000050000000069, 2.0900001000000001, 0)
     results3 = (num_array([ 0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1]), -0.045000050000000069, 2.0900001000000001, 0)
     results4 = (num_array([ 0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1,  0.1]), -0.045000050000000069, 2.0900001000000001, 0)
     
     i = 0
     for d in data:
         self.assertEqual( stats.relfreq( d )[i], results1[i])
         i += 1
コード例 #3
0
print(stats.itemfreq(l))
print(stats.itemfreq(a))
print('scoreatpercentile:', stats.scoreatpercentile(l, 40),
      stats.scoreatpercentile(lf, 40), stats.scoreatpercentile(a, 40),
      stats.scoreatpercentile(af, 40))
print('percentileofscore:', stats.percentileofscore(l, 12),
      stats.percentileofscore(lf, 12), stats.percentileofscore(a, 12),
      stats.percentileofscore(af, 12))
print('histogram:', stats.histogram(l), stats.histogram(a))
print('cumfreq:')
print(stats.cumfreq(l))
print(stats.cumfreq(lf))
print(stats.cumfreq(a))
print(stats.cumfreq(af))
print('relfreq:')
print(stats.relfreq(l))
print(stats.relfreq(lf))
print(stats.relfreq(a))
print(stats.relfreq(af))

print('\nVARIATION')
print('obrientransform:')

l = list(range(1, 21))
a = N.array(l)
ll = [l] * 5
aa = N.array(ll)

print(stats.obrientransform(l, l, l, l, l))
print(stats.obrientransform(a, a, a, a, a))
コード例 #4
0
print '\nFREQUENCY'
print 'freqtable:'
print 'itemfreq:'
print stats.itemfreq(l)
print stats.itemfreq(a)
print 'scoreatpercentile:',stats.scoreatpercentile(l,40),stats.scoreatpercentile(lf,40),stats.scoreatpercentile(a,40),stats.scoreatpercentile(af,40)
print 'percentileofscore:',stats.percentileofscore(l,12),stats.percentileofscore(lf,12),stats.percentileofscore(a,12),stats.percentileofscore(af,12)
print 'histogram:',stats.histogram(l),stats.histogram(a)
print 'cumfreq:'
print stats.cumfreq(l)
print stats.cumfreq(lf)
print stats.cumfreq(a)
print stats.cumfreq(af)
print 'relfreq:'
print stats.relfreq(l)
print stats.relfreq(lf)
print stats.relfreq(a)
print stats.relfreq(af)

print '\nVARIATION'
print 'obrientransform:'

l = range(1,21)
a = N.array(l)
ll = [l]*5
aa = N.array(ll)

print stats.obrientransform(l,l,l,l,l)
print stats.obrientransform(a,a,a,a,a)
コード例 #5
0
 def evaluate(self, *args, **params):
     return _stats.relfreq(*args, **params)
コード例 #6
0
ファイル: test_allstats.py プロジェクト: haavee/RDBE
print stats.itemfreq(l)
print stats.itemfreq(a)
print 'scoreatpercentile:', stats.scoreatpercentile(
    l, 40), stats.scoreatpercentile(lf, 40), stats.scoreatpercentile(
        a, 40), stats.scoreatpercentile(af, 40)
print 'percentileofscore:', stats.percentileofscore(
    l, 12), stats.percentileofscore(lf, 12), stats.percentileofscore(
        a, 12), stats.percentileofscore(af, 12)
print 'histogram:', stats.histogram(l), stats.histogram(a)
print 'cumfreq:'
print stats.cumfreq(l)
print stats.cumfreq(lf)
print stats.cumfreq(a)
print stats.cumfreq(af)
print 'relfreq:'
print stats.relfreq(l)
print stats.relfreq(lf)
print stats.relfreq(a)
print stats.relfreq(af)

print '\nVARIATION'
print 'obrientransform:'

l = range(1, 21)
a = N.array(l)
ll = [l] * 5
aa = N.array(ll)

print stats.obrientransform(l, l, l, l, l)
print stats.obrientransform(a, a, a, a, a)