mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-12 15:26:54 +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:
@@ -187,7 +187,7 @@ class MockInstrumentStorage(MockStorageBase, InstrumentStorage):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__()
|
||||
instruments = {}
|
||||
for symbol, group in self.df.groupby(by="symbol"):
|
||||
for symbol, group in self.df.groupby(by="symbol", group_keys=False):
|
||||
start = group["datetime"].iloc[0]
|
||||
end = group["datetime"].iloc[-1]
|
||||
instruments[symbol] = [(start, end)]
|
||||
|
||||
Reference in New Issue
Block a user