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

Method replace

qlib/utils/index_data.py:451–457  ·  view source on GitHub ↗
(self, to_replace: Dict[np.number, np.number])

Source from the content-addressed store, hash-verified

449 return self.__class__(tmp_data, *self.indices)
450
451 def replace(self, to_replace: Dict[np.number, np.number]):
452 assert isinstance(to_replace, dict)
453 tmp_data = self.data.copy()
454 for num in to_replace:
455 if num in tmp_data:
456 tmp_data[self.data == num] = to_replace[num]
457 return self.__class__(tmp_data, *self.indices)
458
459 def apply(self, func: Callable):
460 """apply a function to data."""

Callers 15

get_source_dataMethod · 0.45
pyMethod · 0.45
_get_eastmoneyFunction · 0.45
_get_nasdaqFunction · 0.45
_get_nyseFunction · 0.45
_formatFunction · 0.45
get_dataMethod · 0.45
normalize_symbolMethod · 0.45
test_corner_casesMethod · 0.45
_get_date_parse_fnFunction · 0.45

Calls 1

copyMethod · 0.80

Tested by 2

test_corner_casesMethod · 0.36
single_with_simulatorFunction · 0.36