本文整理汇总了Python中bamboo.models.observation.Observation.delete方法的典型用法代码示例。如果您正苦于以下问题:Python Observation.delete方法的具体用法?Python Observation.delete怎么用?Python Observation.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bamboo.models.observation.Observation
的用法示例。
在下文中一共展示了Observation.delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: delete_observation
# 需要导入模块: from bamboo.models.observation import Observation [as 别名]
# 或者: from bamboo.models.observation.Observation import delete [as 别名]
def delete_observation(self, index):
"""Delete observation at index.
:params index: The index of an observation to delete.
"""
Observation.delete(self, index)
dframe = self.dframe()
self.update({self.NUM_ROWS: len(dframe)})
self.build_schema(dframe, overwrite=True)
示例2: test_delete_one
# 需要导入模块: from bamboo.models.observation import Observation [as 别名]
# 或者: from bamboo.models.observation.Observation import delete [as 别名]
def test_delete_one(self):
self.__save_records()
records = Observation.find(self.dataset)
self.assertNotEqual(records, [])
row = self.__decode(records[0])
Observation.delete(self.dataset, row[INDEX])
new_records = Observation.find(self.dataset)
# Dump to avoid problems with nan != nan.
self.assertEqual(dump_mongo_json(records[1:]),
dump_mongo_json(new_records))