| [ Web Proxy ] |
| Viewing: https://numpy.org/doc/stable/reference/generated/../c-api/../generated/numpy.char.expandtabs.html | [Back] [Original] |
Return a copy of each string element where all tab characters are replaced by one or more spaces.
Calls str.expandtabs element-wise.
Return a copy of each string element where all tab characters are replaced by one or more spaces, depending on the current column and the given tabsize. The column number is reset to zero after each newline occurring in the string. This doesnt understand other non-printing characters or escape sequences.
StringDType, bytes_, or str_ dtypeInput array
Replace tabs with tabsize number of spaces. If not given defaults to 8 spaces.
Output array of StringDType, bytes_ or str_ dtype,
depending on input type
See also
Examples
>>> import numpy as np
>>> a = np.array([' Hello world'])
>>> np.strings.expandtabs(a, tabsize=4)
array([' Hello world'], dtype='<U21')
| Web Proxy Viewer | New URL | Original Page |