source: orange/Orange/doc/reference/undefineds.py @ 9671:a7b056375472

Revision 9671:a7b056375472, 799 bytes checked in by anze <anze.staric@…>, 2 years ago (diff)

Moved orange to Orange (part 2)

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.