exampletable3.py

来自「orange源码 数据挖掘技术」· Python 代码 · 共 27 行

PY
27
字号
# Description: Shows how to filter examples in ExampleTable using method 'filter'
# Category:    basic classes, preprocessing, filtering
# Classes:     ExampleTable
# Uses:        lenses
# Referenced:  ExampleTable.htm

import orange

data = orange.ExampleTable("lenses")

young = data.filter(age="young")
print "Selection: age=young"
for ex in young:
    print ex
print


young = data.filter(age=["young", "presbyopic"], astigmatic="yes")
print "Selection: age=young or presbyopic, astigmatic=yes"
for ex in young:
    print ex
print
    
print "Selection: NOT age=young, astigmatic=yes"
young = data.filter({"age": "young", "astigmatic": "yes"}, negate=1)
for ex in young:
    print ex

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?