本文整理匯總了Python中blaze.expr.Symbol.like方法的典型用法代碼示例。如果您正苦於以下問題:Python Symbol.like方法的具體用法?Python Symbol.like怎麽用?Python Symbol.like使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類blaze.expr.Symbol
的用法示例。
在下文中一共展示了Symbol.like方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_like
# 需要導入模塊: from blaze.expr import Symbol [as 別名]
# 或者: from blaze.expr.Symbol import like [as 別名]
def test_like():
t = Symbol('t', 'var * {name: string, city: string}')
data = [('Alice Smith', 'New York'),
('Bob Smith', 'Chicago'),
('Alice Walker', 'LA')]
assert list(compute(t.like(name='Alice*'), data)) == [data[0], data[2]]
assert list(compute(t.like(name='lice*'), data)) == []
assert list(compute(t.like(name='*Smith*'), data)) == [data[0], data[1]]
assert list(compute(t.like(name='*Smith*', city='New York'), data)) == [data[0]]
示例2: sin
# 需要導入模塊: from blaze.expr import Symbol [as 別名]
# 或者: from blaze.expr.Symbol import like [as 別名]
except pymongo.errors.ConnectionFailure:
mongo = None
# {expr: [list-of-exclusions]}
expressions = {
t: [],
t['id']: [],
t.id.max(): [],
t.amount.sum(): [],
t.amount.head(): [],
t.amount + 1: [mongo],
sin(t.amount): [sql, mongo], # sqlite doesn't support trig
exp(t.amount): [sql, mongo],
t.amount > 50: [mongo],
t[t.amount > 50]: [],
t.like(name='Alic*'): [],
t.sort('name'): [bc],
t.sort('name', ascending=False): [bc],
t.head(3): [],
t.name.distinct(): [],
t[t.amount > 50]['name']: [], # odd ordering issue
t.id.map(lambda x: x + 1, schema='int', name='id'): [sql, mongo],
t[t.amount > 50]['name']: [],
by(t.name, t.amount.sum()): [],
by(t.id, t.id.count()): [],
by(t[['id', 'amount']], t.id.count()): [],
by(t[['id', 'amount']], (t.amount + 1).sum()): [mongo],
by(t[['id', 'amount']], t.name.nunique()): [mongo],
by(t.id, t.amount.count()): [],
by(t.id, t.id.nunique()): [mongo],
# by(t, t.count()): [],