MCPcopy Create free account
hub / github.com/numpy/numpy / expandtabs

Function expandtabs

numpy/core/defchararray.py:707–739  ·  view source on GitHub ↗

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

(a, tabsize=8)

Source from the content-addressed store, hash-verified

705
706@array_function_dispatch(_expandtabs_dispatcher)
707def expandtabs(a, tabsize=8):
708 """
709 Return a copy of each string element where all tab characters are
710 replaced by one or more spaces.
711
712 Calls `str.expandtabs` element-wise.
713
714 Return a copy of each string element where all tab characters are
715 replaced by one or more spaces, depending on the current column
716 and the given `tabsize`. The column number is reset to zero after
717 each newline occurring in the string. This doesn't understand other
718 non-printing characters or escape sequences.
719
720 Parameters
721 ----------
722 a : array_like of str or unicode
723 Input array
724 tabsize : int, optional
725 Replace tabs with `tabsize` number of spaces. If not given defaults
726 to 8 spaces.
727
728 Returns
729 -------
730 out : ndarray
731 Output array of str or unicode, depending on input type
732
733 See Also
734 --------
735 str.expandtabs
736
737 """
738 return _to_bytes_or_str_array(
739 _vec_string(a, object_, 'expandtabs', (tabsize,)), a)
740
741
742@array_function_dispatch(_count_dispatcher)

Callers 1

expandtabsMethod · 0.85

Calls 2

_vec_stringFunction · 0.90
_to_bytes_or_str_arrayFunction · 0.85

Tested by

no test coverage detected