本文整理匯總了Python中neo.core.analogsignal.AnalogSignal.annotations["index"]方法的典型用法代碼示例。如果您正苦於以下問題:Python AnalogSignal.annotations["index"]方法的具體用法?Python AnalogSignal.annotations["index"]怎麽用?Python AnalogSignal.annotations["index"]使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neo.core.analogsignal.AnalogSignal
的用法示例。
在下文中一共展示了AnalogSignal.annotations["index"]方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test__pickle
# 需要導入模塊: from neo.core.analogsignal import AnalogSignal [as 別名]
# 或者: from neo.core.analogsignal.AnalogSignal import annotations["index"] [as 別名]
def test__pickle(self):
signal1 = AnalogSignal([1, 2, 3, 4], sampling_period=1 * pq.ms, units=pq.S, channel_index=42)
signal1.annotations["index"] = 2
fobj = open("./pickle", "wb")
pickle.dump(signal1, fobj)
fobj.close()
fobj = open("./pickle", "rb")
try:
signal2 = pickle.load(fobj)
except ValueError:
signal2 = None
assert_arrays_equal(signal1, signal2)
self.assertEqual(signal1.channel_index, signal2.channel_index, 42)
fobj.close()
os.remove("./pickle")