modin.pandas.Series.str.lstrip¶
- Series.str.lstrip(to_strip=None)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/.tox/docs/lib/python3.9/site-packages/modin/pandas/series_utils.py#L431-L434)¶
Remove leading characters.
Strip whitespaces (including newlines) or a set of specified characters from each string in the Series/Index from left side. Replaces any non-strings in Series with NaNs. Equivalent to str.lstrip().
- Parameters:
to_strip (str or None, default None) – Specifying the set of characters to be removed. All combinations of this set of characters will be stripped. If None then whitespaces are removed.
- Return type:
Series or Index of object
See also
Series.str.strip
Remove leading and trailing characters in Series/Index.
Series.str.lstrip
Remove leading characters in Series/Index.
Series.str.rstrip
Remove trailing characters in Series/Index.
Examples
>>> s = pd.Series(['1. Ant. ', '2. Bee!\n', '3. Cat?\t', np.nan, 10, True]) >>> s 0 1. Ant. 1 2. Bee!\n 2 3. Cat?\t 3 None 4 10 5 True dtype: object
>>> s.str.lstrip('123.') 0 Ant. 1 Bee!\n 2 Cat?\t 3 None 4 None 5 None dtype: object