本文整理汇总了Python中RUtil.run_with_table方法的典型用法代码示例。如果您正苦于以下问题:Python RUtil.run_with_table方法的具体用法?Python RUtil.run_with_table怎么用?Python RUtil.run_with_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RUtil
的用法示例。
在下文中一共展示了RUtil.run_with_table方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_response_content
# 需要导入模块: import RUtil [as 别名]
# 或者: from RUtil import run_with_table [as 别名]
def get_response_content(fs):
# get the r table
rtable = RUtil.RTable(fs.table.splitlines())
header_row = rtable.headers
data_rows = rtable.data
Carbone.validate_headers(header_row)
# check requested variable names as column headers
if fs.var_a not in header_row:
raise ValueError('the first variable name is not column header')
if fs.var_b not in header_row:
raise ValueError('the second variable name is not column header')
return RUtil.run_with_table(fs.table, fs, get_script_content)
示例2: get_response_content
# 需要导入模块: import RUtil [as 别名]
# 或者: from RUtil import run_with_table [as 别名]
def get_response_content(fs):
# get the r table
rtable = RUtil.RTable(fs.table.splitlines())
header_row = rtable.headers
data_rows = rtable.data
Carbone.validate_headers(header_row)
# check requested variable names as column headers
if fs.variable not in header_row:
msg = 'the variable name was not found as a column in the data table'
raise ValueError(msg)
if fs.factor not in header_row:
msg = 'the factor name was not found as a column in the data table'
raise ValueError(msg)
return RUtil.run_with_table(fs.table, fs, get_script_content)
示例3: get_response_content
# 需要导入模块: import RUtil [as 别名]
# 或者: from RUtil import run_with_table [as 别名]
def get_response_content(fs):
# get the independent variable names
indep = Util.get_stripped_lines(fs.independent.splitlines())
dep = fs.dependent
# get the r table
rtable = RUtil.RTable(fs.table.splitlines())
header_row = rtable.headers
data_rows = rtable.data
Carbone.validate_headers(header_row)
# check requested variable names as column headers
bad_indep_names = set(indep) - set(header_row)
if bad_indep_names:
raise ValueError(
"these requested independent variable names "
"were not found as columns "
"in the data table: " + str(bad_indep_names)
)
if dep not in header_row:
raise ValueError("the dependent variable name " "was not found as a column in the data table")
return RUtil.run_with_table(fs.table, (indep, dep), get_script_content)