MCPcopy
hub / github.com/pydata/xarray / lstrip

Method lstrip

xarray/core/accessor_str.py:1599–1620  ·  view source on GitHub ↗

Remove leading characters. Strip whitespaces (including newlines) or a set of specified characters from each string in the array from the left side. `to_strip` can either be a ``str`` or array-like of ``str``. If array-like, it will be broadcast and applied

(self, to_strip: str | bytes | Any = None)

Source from the content-addressed store, hash-verified

1597 return self._apply(func=func, func_args=(to_strip,))
1598
1599 def lstrip(self, to_strip: str | bytes | Any = None) -> T_DataArray:
1600 """
1601 Remove leading characters.
1602
1603 Strip whitespaces (including newlines) or a set of specified characters
1604 from each string in the array from the left side.
1605
1606 `to_strip` can either be a ``str`` or array-like of ``str``.
1607 If array-like, it will be broadcast and applied elementwise.
1608
1609 Parameters
1610 ----------
1611 to_strip : str or array-like of str or None, default: None
1612 Specifying the set of characters to be removed.
1613 All combinations of this set of characters will be stripped.
1614 If None then whitespaces are removed. If array-like, it is broadcast.
1615
1616 Returns
1617 -------
1618 stripped : same type as values
1619 """
1620 return self.strip(to_strip, side="left")
1621
1622 def rstrip(self, to_strip: str | bytes | Any = None) -> T_DataArray:
1623 """

Callers 7

stripMethod · 0.80
_open_existing_arrayMethod · 0.80
assert_expected_filesMethod · 0.80
test_empty_str_methodsFunction · 0.80
test_strip_lstrip_rstripFunction · 0.80

Calls 1

stripMethod · 0.95

Tested by 5

assert_expected_filesMethod · 0.64
test_empty_str_methodsFunction · 0.64
test_strip_lstrip_rstripFunction · 0.64