> ## Documentation Index
> Fetch the complete documentation index at: https://systematica.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Resampling

> systematica.utils.resampling

## `resample_nb`

```python theme={null}
resample_nb(
    close: numpy.ndarray,
    index: numpy.ndarray,
    freq: numpy.timedelta64,
) ‑> numpy.ndarray
```

Resample financial data to a specified frequency using a Numba-compiled
function.

This function utilizes Numba's Just-in-Time (JIT) compilation to optimize
performance for resampling time series data, keeping the last value within
each resampling period.

**Parameters**:

| Name    | Type             | Default | Description                                                                                                                                                                     |
| ------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `close` | `tp.Array2d`     | `--`    | A 2-dimensional array of asset closing prices, where rows represent time and columns represent assets.                                                                          |
| `index` | `tp.Array1d`     | `--`    | A 1-dimensional array of datetime values corresponding to the time index of `close`.                                                                                            |
| `freq`  | `np.timedelta64` | `--`    | A Numpy `timedelta64` object representing the desired frequency for resampling. For example, `np.timedelta64(1, 'D')` for daily data, `np.timedelta64(1, 'W')` for weekly, etc. |

**Returns**:

| Type         | Description                                                                                                                         |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| `tp.Array2d` | A 2-dimensional array of resampled closing prices, with rows corresponding to the resampled time periods and columns to the assets. |

## `resample`

```python theme={null}
resample(
    data: vectorbtpro.data.base.Data,
    freq: str,
    **kwargs,
) ‑> vectorbtpro.data.base.Data
```

Reasample data.

**Parameters**:

| Name   | Type       | Default | Description                                              |
| ------ | ---------- | ------- | -------------------------------------------------------- |
| `data` | `vbt.Data` | `--`    | Data object.                                             |
| `freq` | `str`      | `--`    | Frequency. kwargs Feed `dt.date_range`. See vectorbtpro. |

**Returns**:

| Type       | Description                |
| ---------- | -------------------------- |
| `vbt.Data` | Resampled vbt Data object. |
