source: orange/orange/doc/modules/sql4.py @ 2429:2bd4005e5b2e

Revision 2429:2bd4005e5b2e, 617 bytes checked in by blaz <blaz.zupan@…>, 8 years ago (diff)

files providing documentation for orngMySQL module

Line 
1# Description: Writes a data set to and reads from MySQL
2# Category:    file formats
3# Classes:     ExampleTable, orngMySQL.Connect
4# Uses:        iris.tab
5# Referenced:  orngMySQL.htm
6
7import orange, orngMySQL, orngTree
8
9data = orange.ExampleTable("iris")
10print "Input data domain:"
11for a in data.domain.variables:
12    print a
13
14t = orngMySQL.Connect('localhost','root','','test')
15t.write('iris', data, overwrite=True)
16
17sel = t.query("SELECT petal_width, petal_length FROM iris WHERE sepal_length<5.0")
18print "\n%d instances returned" % len(sel)
19print "Output data domain:"
20for a in sel.domain.variables:
21    print a
Note: See TracBrowser for help on using the repository browser.