| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../random/../generated/numpy.char.mod.html | [Back] [Original] |
Return (a % i), that is pre-Python 2.6 string formatting (interpolation), element-wise for a pair of array_likes of str or unicode.
bytes_ or str_ dtypeThese values will be element-wise interpolated into the string.
Output array of StringDType, bytes_ or str_ dtype,
depending on input types
Examples
>>> import numpy as np
>>> a = np.array(["NumPy is a %s library"])
>>> np.strings.mod(a, values=["Python"])
array(['NumPy is a Python library'], dtype='<U25')
>>> a = np.array([b'%d bytes', b'%d bits'])
>>> values = np.array([8, 64])
>>> np.strings.mod(a, values)
array([b'8 bytes', b'64 bits'], dtype='|S7')
| Web Proxy Viewer | New URL | Original Page |