MCPcopy Index your code
hub / github.com/microsoft/qlib / from_df

Method from_df

qlib/data/dataset/handler.py:766–786  ·  view source on GitHub ↗

Motivation: - When user want to get a quick data handler. The created data handler will have only one shared Dataframe without processors. After creating the handler, user may often want to dump the handler for reuse Here is a typical use case .. co

(cls, df: pd.DataFrame)

Source from the content-addressed store, hash-verified

764
765 @classmethod
766 def from_df(cls, df: pd.DataFrame) -> "DataHandlerLP":
767 """
768 Motivation:
769 - When user want to get a quick data handler.
770
771 The created data handler will have only one shared Dataframe without processors.
772 After creating the handler, user may often want to dump the handler for reuse
773 Here is a typical use case
774
775 .. code-block:: python
776
777 from qlib.data.dataset import DataHandlerLP
778 dh = DataHandlerLP.from_df(df)
779 dh.to_pickle(fname, dump_all=True)
780
781 TODO:
782 - The StaticDataLoader is quite slow. It don't have to copy the data again...
783
784 """
785 loader = data_loader_module.StaticDataLoader(df)
786 return cls(data_loader=loader)

Callers 2

test_handler_dfMethod · 0.45
__call__Method · 0.45

Calls

no outgoing calls

Tested by 1

test_handler_dfMethod · 0.36