当前位置: 首页>>代码示例>>Python>>正文


Python DataArray.data[:,i]方法代码示例

本文整理汇总了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
开发者ID:foss-transportationmodeling,项目名称:simtravel,代码行数:18,代码来源:interaction_model.py

示例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
开发者ID:osPlanning,项目名称:simtravel,代码行数:17,代码来源:abstract_model.py


注:本文中的openamos.core.data_array.DataArray.data[:,i]方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。