本文整理汇总了Python中Orange.data.ContinuousVariable.attributes['Time']方法的典型用法代码示例。如果您正苦于以下问题:Python ContinuousVariable.attributes['Time']方法的具体用法?Python ContinuousVariable.attributes['Time']怎么用?Python ContinuousVariable.attributes['Time']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Orange.data.ContinuousVariable
的用法示例。
在下文中一共展示了ContinuousVariable.attributes['Time']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: etc_to_table
# 需要导入模块: from Orange.data import ContinuousVariable [as 别名]
# 或者: from Orange.data.ContinuousVariable import attributes['Time'] [as 别名]
def etc_to_table(self, etc_json, time_var=False, callback=lambda: None):
""" Converts data from Json to :obj:`Orange.data.table`
Args:
etc_json (dict): Data in json like format
time_var (bool): Create column of time points. Default is set to False.
Returns:
:obj:`Orange.data.Table`
"""
cbc = CallBack(2, callback, callbacks=30)
variables = []
time_point = 1
for time in etc_json['etc']['timePoints']:
var = ContinuousVariable('TP ' + str(time_point))
var.attributes['Time'] = str(time)
variables.append(var)
time_point += 1
meta_attr = StringVariable.make('Gene')
domain = Domain(variables, metas=[meta_attr])
cbc()
table = []
for row in etc_json['etc']['genes']:
gene_expression = [exp for exp in etc_json['etc']['genes'][row]]
gene_expression.append(row)
table.append(gene_expression)
orange_table = Table(domain, table)
if time_var:
orange_table = transpose_table(orange_table)
cbc()
cbc.end()
return orange_table