本文整理汇总了Python中pycast.common.matrix.Matrix.from_timeseries方法的典型用法代码示例。如果您正苦于以下问题:Python Matrix.from_timeseries方法的具体用法?Python Matrix.from_timeseries怎么用?Python Matrix.from_timeseries使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pycast.common.matrix.Matrix
的用法示例。
在下文中一共展示了Matrix.from_timeseries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_from_multi_dimensional_timeseries_test
# 需要导入模块: from pycast.common.matrix import Matrix [as 别名]
# 或者: from pycast.common.matrix.Matrix import from_timeseries [as 别名]
def create_from_multi_dimensional_timeseries_test(self):
"""Test to cretae a Matrix from a multi dimensional Timeseries."""
# initialize Timeseries
dataOne = [
[0.0, [0.0, 1.3]],
[0.1, [0.5, 3.5]],
[0.2, [0.2, 4.7]]
]
tsOne = MDTS.from_twodim_list(dataOne, dimensions=2)
# create Matrix
mtrx = Matrix.from_timeseries(tsOne)
exRes = [
[0.0, 0.5, 0.2],
[1.3, 3.5, 4.7]
]
self.assertEqual(mtrx.matrix, exRes)
示例2: create_from_timeseries_test
# 需要导入模块: from pycast.common.matrix import Matrix [as 别名]
# 或者: from pycast.common.matrix.Matrix import from_timeseries [as 别名]
def create_from_timeseries_test(self):
"""Test to create a Matrix from a one dimensional Timeseries."""
# initialize Timeseries
dataOne = [
[0.0, 0.0],
[0.1, 0.1],
[0.2, 0.2],
[0.3, 0.3],
[0.4, 0.4],
[0.5, 0.5]
]
tsOne = TimeSeries.from_twodim_list(dataOne)
# create Matrix
mtrx = Matrix.from_timeseries(tsOne)
exRes = [[entry[1] for entry in dataOne]]
self.assertEqual(mtrx.matrix, exRes)