mirror of
https://github.com/microsoft/qlib.git
synced 2026-06-06 05:51:17 +08:00
fixed a problem with multi index caused by the default value of groupkey (#1917)
* fixed a problem with multi index caused by the default value of groupkey * modify group_key default value * limit pandas verion * format with black * fix docs error * fix docs error * fixed bugs caused by pandas upgrade * remove needless code * reformat with black * limit version & add docs
This commit is contained in:
@@ -7,8 +7,8 @@ from qlib.tests import TestAutoData
|
||||
class TestDataset(TestAutoData):
|
||||
def testCSI300(self):
|
||||
close_p = D.features(D.instruments("csi300"), ["$close"])
|
||||
size = close_p.groupby("datetime").size()
|
||||
cnt = close_p.groupby("datetime").count()["$close"]
|
||||
size = close_p.groupby("datetime", group_keys=False).size()
|
||||
cnt = close_p.groupby("datetime", group_keys=False).count()["$close"]
|
||||
size_desc = size.describe(percentiles=np.arange(0.1, 1.0, 0.1))
|
||||
cnt_desc = cnt.describe(percentiles=np.arange(0.1, 1.0, 0.1))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user