For each element in a, return a copy with the leading characters removed.
Calls str.lstrip element-wise.
Parameters : | a : array-like of str or unicode chars : str or unicode, optional
|
---|---|
Returns : | out : ndarray, str or unicode
|
See also
Examples
>>> c = np.array(['aAaAaA', ' aA ', 'abBABba'])
>>> c
array(['aAaAaA', ' aA ', 'abBABba'],
dtype='|S7')
>>> np.char.lstrip(c, 'a') # 'a' unstripped from c[1] because whitespace leading
array(['AaAaA', ' aA ', 'bBABba'],
dtype='|S7')
>>> np.char.lstrip(c, 'A') # leaves c unchanged
array(['aAaAaA', ' aA ', 'abBABba'],
dtype='|S7')
>>> (np.char.lstrip(c, ' ') == np.char.lstrip(c, '')).all()
... # XXX: is this a regression? this line now returns False
... # np.char.lstrip(c,'') does not modify c at all.
True
>>> (np.char.lstrip(c, ' ') == np.char.lstrip(c, None)).all()
True