source: orange/orange/doc/ofb/report_missing.py @ 6538:a5f65d7f0b2c

Revision 6538:a5f65d7f0b2c, 622 bytes checked in by Mitar <Mitar@…>, 4 years ago (diff)

Made XPM version of the icon 32x32.

Line 
1# Description: Read data and for each attribute report percent of instances with missing value
2# Category:    description
3# Uses:        adult_sample.tab
4# Referenced:  basic_exploration.htm
5
6import orange
7data = orange.ExampleTable("../datasets/adult_sample")
8
9natt = len(data.domain.attributes)
10missing = [0.] * natt
11for i in data:
12    for j in range(natt):
13        if i[j].isSpecial():
14            missing[j] += 1
15missing = map(lambda x, l=len(data):x/l*100., missing)
16
17print "Missing values per attribute:"
18atts = data.domain.attributes
19for i in range(natt):
20    print %5.1f%s %s" % (missing[i], '%', atts[i].name)
Note: See TracBrowser for help on using the repository browser.