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

Method repeat

xarray/core/accessor_str.py:1692–1714  ·  view source on GitHub ↗

Repeat each string in the array. If `repeats` is array-like, it is broadcast against the array and applied elementwise. Parameters ---------- repeats : int or array-like of int Number of repetitions. If array-like, it is broa

(
        self,
        repeats: int | Any,
    )

Source from the content-addressed store, hash-verified

1690 return self._apply(func=func)
1691
1692 def repeat(
1693 self,
1694 repeats: int | Any,
1695 ) -> T_DataArray:
1696 """
1697 Repeat each string in the array.
1698
1699 If `repeats` is array-like, it is broadcast against the array and applied
1700 elementwise.
1701
1702 Parameters
1703 ----------
1704 repeats : int or array-like of int
1705 Number of repetitions.
1706 If array-like, it is broadcast.
1707
1708 Returns
1709 -------
1710 repeated : same type as values
1711 Array of repeated string objects.
1712 """
1713 func = lambda x, y: x * y
1714 return self._apply(func=func, func_args=(repeats,))
1715
1716 def find(
1717 self,

Callers 13

__mul__Method · 0.95
setupMethod · 0.80
first_itemsMethod · 0.80
factorizeMethod · 0.80
first_itemsMethod · 0.80
to_indexMethod · 0.80
apply_groupby_funcFunction · 0.80
test_upsample_ndMethod · 0.80
test_repeatFunction · 0.80
test_repeat_broadcastFunction · 0.80

Calls 1

_applyMethod · 0.95

Tested by 6

test_upsample_ndMethod · 0.64
test_repeatFunction · 0.64
test_repeat_broadcastFunction · 0.64
test_empty_str_methodsFunction · 0.64