1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-06 04:20:57 +08:00
This commit is contained in:
Young
2021-08-31 09:52:32 +00:00
committed by you-n-g
parent 9a74471ab6
commit 5f0ee6ce68
3 changed files with 35 additions and 13 deletions

View File

@@ -89,6 +89,12 @@ class IndexDataTest(unittest.TestCase):
with self.assertRaises(KeyError):
sd.loc["foo"]
# replace
sd = idd.SingleData([1, 2, 3, 4], index=["foo", "bar", "f", "g"])
sd = sd.replace(dict(zip(range(1, 5), range(2, 6))))
print(sd)
self.assertTrue(sd.iloc[0] == 2)
def test_ops(self):
sd1 = idd.SingleData([1, 2, 3, 4], index=["foo", "bar", "f", "g"])
sd2 = idd.SingleData([1, 2, 3, 4], index=["foo", "bar", "f", "g"])