source: orange/Orange/testing/regression/tests_20/reference_basicattrstat.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 506 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

Line 
1# Description: Shows how to compute and print out the basic attribute statistics
2# Category:    statistics
3# Classes:     DomainBasicAttrStat, BasicAttrStat
4# Uses:        iris
5# Referenced:  basicstat.htm
6
7import orange
8data = orange.ExampleTable("iris")
9bas = orange.DomainBasicAttrStat(data)
10
11print "%20s  %5s  %5s  %5s" % ("attribute", "min", "max", "avg")
12for a in bas:
13    if a:
14        print "%20s  %5.3f  %5.3f  %5.3f" % (a.variable.name, a.min, a.max, a.avg)
15
16print bas["sepal length"].avg       
Note: See TracBrowser for help on using the repository browser.