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
|
---|---|
Returns: | out : ndarray
|
See also
Examples
>>> c = np.array(['aAaAaA', 'abBABba'], dtype='S7'); c
array(['aAaAaA', 'abBABba'],
dtype='|S7')
>>> np.char.rstrip(c, 'a')
array(['aAaAaA', 'abBABb'],
dtype='|S6')
>>> np.char.rstrip(c, 'A')
array(['aAaAa', 'abBABba'],
dtype='|S7')