📄 filters.py
字号:
import orange
############ THIS IS WHAT YOU CAN DO WITH DISCRETE ATTRIBUTES
data = orange.ExampleTable("lenses")
data[0][0] = "?"
data[1][0] = "?"
data[1][1] = "?"
fspec = orange.Filter_isDefined(domain=data.domain)
print "\nCheck all attributes"
print [fspec(ex) for ex in data]
print "\nCheck all attributes (but with 'check' given)"
fspec.check = [1] * len(data.domain)
print [fspec(ex) for ex in data]
print "\nIgnore the first attribute"
fspec.check[0] = 0
print [fspec(ex) for ex in data]
print "\nIgnore the first attribute, check the second (and ignore the rest, list is too short)"
fspec.check = [0, 1]
data[0][3] = "?"
print [fspec(ex) for ex in data]
print "\nAdd the 'age' to the list of the checked"
fspec.check["age"] = 1
print [fspec(ex) for ex in data]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -