numpy.core.defchararray.rstrip(a, chars=None)
[source]
For each element in a
, return a copy with the trailing characters removed.
Calls str.rstrip
element-wise.
Parameters: |
a : array-like of str or unicode chars : str or unicode, optional The |
---|---|
Returns: |
out : ndarray Output array of str or unicode, depending on input type |
See also
>>> c = np.array(['aAaAaA', 'abBABba'], dtype='S7'); c array(['aAaAaA', 'abBABba'], dtype='|S7') >>> np.char.rstrip(c, 'a') array(['aAaAaA', 'abBABb'], dtype='|S7') >>> np.char.rstrip(c, 'A') array(['aAaAa', 'abBABba'], dtype='|S7')
© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.core.defchararray.rstrip.html