MCPcopy Index your code
hub / github.com/numpy/numpy / replace

Method replace

numpy/_core/defchararray.py:1001–1011  ·  view source on GitHub ↗

For each element in `self`, return a copy of the string with all occurrences of substring `old` replaced by `new`. See Also -------- char.replace

(self, old, new, count=None)

Source from the content-addressed store, hash-verified

999 return asarray(partition(self, sep))
1000
1001 def replace(self, old, new, count=None):
1002 """
1003 For each element in `self`, return a copy of the string with all
1004 occurrences of substring `old` replaced by `new`.
1005
1006 See Also
1007 --------
1008 char.replace
1009
1010 """
1011 return replace(self, old, new, count if count is not None else -1)
1012
1013 def rfind(self, sub, start=0, end=None):
1014 """

Callers 15

mainFunction · 0.80
find_missingFunction · 0.80
parse_distributions_hFunction · 0.80
test_reprMethod · 0.80
test_strMethod · 0.80
_void_scalar_to_stringFunction · 0.80
_parse_einsum_inputFunction · 0.80
einsum_pathFunction · 0.80
getMethod · 0.80
__init__Method · 0.80
indentFunction · 0.80

Calls 1

replaceFunction · 0.70

Tested by 15

test_reprMethod · 0.64
test_strMethod · 0.64
test_replace_promoterFunction · 0.64
assert_features_equalFunction · 0.64
_text_to_listFunction · 0.64
_to_unsignedMethod · 0.64
test_replaceMethod · 0.64