from siuba.dply.verbs import Var, VarList, var_select
from siuba import _
import pandas as pd
from pandas import DataFrame, Series
v = VarList()
colnames = ['a', 'b', 'c', 'd']
var_select(
colnames,
v.x == v.a,
-v.d,
)
OrderedDict([('a', 'x'), ('b', None), ('c', None)])
colnames = ["home_phone", "home_address", "other", "misc"]
var_select(
colnames,
v.startswith("home"),
v.misc
)
OrderedDict([('home_phone', None), ('home_address', None), ('misc', None)])
colnames = ["home_phone", "home_address", "other", "misc"]
var_select(
colnames,
v[v.home_phone:v.home_address]
)
OrderedDict([('home_phone', None), ('home_address', None)])
f = _.startswith("a")
f(v)
Var('_.startswith('a')', negated = False, alias = None)