本文整理汇总了Python中openamos.core.data_array.DataArray.data[:,i]方法的典型用法代码示例。如果您正苦于以下问题:Python DataArray.data[:,i]方法的具体用法?Python DataArray.data[:,i]怎么用?Python DataArray.data[:,i]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openamos.core.data_array.DataArray
的用法示例。
在下文中一共展示了DataArray.data[:,i]方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: calculate_expected_values
# 需要导入模块: from openamos.core.data_array import DataArray [as 别名]
# 或者: from openamos.core.data_array.DataArray import data[:,i] [as 别名]
def calculate_expected_values(self, data):
"""
The method returns the product using the coefficients
in the specification input as power.
Inputs:
data - DataArray object
"""
num_choices = self.specification.number_choices
expected_value_array = DataArray(zeros((data.rows, num_choices)),
self.choices)
self.inverse = self.specification.inverse[0]
for i in range(num_choices):
coefficients = self.coefficients[i]
expected_value_array.data[:,i] = data.calculate_product(coefficients, inverse=self.inverse)
return expected_value_array
示例2: calculate_expected_values
# 需要导入模块: from openamos.core.data_array import DataArray [as 别名]
# 或者: from openamos.core.data_array.DataArray import data[:,i] [as 别名]
def calculate_expected_values(self, data):
"""
The method returns the expected values for the different choices
using the coefficients in the specification input.
Inputs:
data - DataArray object
"""
num_choices = self.specification.number_choices
expected_value_array = DataArray(zeros((data.rows, num_choices)), self.choices)
for i in range(num_choices):
coefficients = self.coefficients[i]
expected_value_array.data[:, i] = data.calculate_equation(coefficients)
return expected_value_array