本文整理汇总了Python中timeseries.TimeSeries.get_events方法的典型用法代码示例。如果您正苦于以下问题:Python TimeSeries.get_events方法的具体用法?Python TimeSeries.get_events怎么用?Python TimeSeries.get_events使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类timeseries.TimeSeries
的用法示例。
在下文中一共展示了TimeSeries.get_events方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_024
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import get_events [as 别名]
def test_024(self):
'getting events of a eventless time series'
obj = TimeSeries(location_id='loc', parameter_id='par')
d1 = datetime(1979, 3, 15, 9, 35)
d3 = datetime(1979, 4, 12, 9, 35)
self.assertEqual(0, len(obj.get_events()))
self.assertEqual(0, len(obj.get_events(d3)))
self.assertEqual(0, len(obj.get_events(d1, d3)))
示例2: test_023
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import get_events [as 别名]
def test_023(self):
'getting events of a non empty time series'
obj = TimeSeries(location_id='loc', parameter_id='par')
d1 = datetime(1979, 3, 15, 9, 35)
d3 = datetime(1979, 4, 12, 9, 35)
d2 = datetime(1979, 5, 15, 9, 35)
obj[d1] = 1.23
obj[d3] = 0.23
obj[d2] = -3.01
self.assertEqual(3, len(obj.get_events()))
self.assertEqual(2, len(obj.get_events(d3)))
self.assertEqual(2, len(obj.get_events(d1, d3)))
示例3: test_020
# 需要导入模块: from timeseries import TimeSeries [as 别名]
# 或者: from timeseries.TimeSeries import get_events [as 别名]
def test_020(self):
'can we ask for the events of an eventless time series?'
obj = TimeSeries(location_id='loc', parameter_id='par')
self.assertEqual(0, len(obj.get_events()))