MCPcopy
hub / github.com/microsoft/qlib / get_group_columns

Function get_group_columns

qlib/data/dataset/processor.py:18–32  ·  view source on GitHub ↗

get a group of columns from multi-index columns DataFrame Parameters ---------- df : pd.DataFrame with multi of columns. group : str the name of the feature group, i.e. the first level value of the group index.

(df: pd.DataFrame, group: Union[Text, None])

Source from the content-addressed store, hash-verified

16
17
18def get_group_columns(df: pd.DataFrame, group: Union[Text, None]):
19 """
20 get a group of columns from multi-index columns DataFrame
21
22 Parameters
23 ----------
24 df : pd.DataFrame
25 with multi of columns.
26 group : str
27 the name of the feature group, i.e. the first level value of the group index.
28 """
29 if group is None:
30 return df.columns
31 else:
32 return df.columns[df.columns.get_loc(group)]
33
34
35class Processor(Serializable):

Callers 9

_transformMethod · 0.85
__call__Method · 0.85
__call__Method · 0.85
fitMethod · 0.85
fitMethod · 0.85
fitMethod · 0.85
__call__Method · 0.85
__call__Method · 0.85
__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected