source: orange/orange/doc/reference/undefineds.py @ 1316:5b7692e9f55a

Revision 1316:5b7692e9f55a, 799 bytes checked in by janezd <janez.demsar@…>, 9 years ago (diff)
  • removed wml and orange/pyxtract (wml is now in orangeom and pyxtract in source/pyxtract)
Line 
1# Description: Shows how to specify the symbols for undefined values in tab-delimited files
2# Category:    data input
3# Classes:     ExampleTable
4# Uses:        undefineds
5# Referenced:  tabdelimited.htm
6
7import orange
8data = orange.ExampleTable("undefineds", DK="GDK", DC="GDC")
9
10for ex in data:
11    print ex
12
13print "Default saving\n"
14orange.saveTabDelimited("undefined-saved.tab", data)
15print open("undefined-saved.tab", "rt").read()
16
17print "Saving with all undefined as NA\n"
18orange.saveTabDelimited("undefined-saved-na.tab", data, NA="NA")
19print open("undefined-saved.tab", "rt").read()
20
21print "Saving with all undefined as NA\n"
22orange.saveTabDelimited("undefined-saved-dc-dk", data, DC="GDC", DK="GDK")
23print open("undefined-saved.tab", "rt").read()
24
25import os
26os.remove("undefined-saved.tab")
Note: See TracBrowser for help on using the repository browser.