Metadata-Version: 2.4
Name: pandas-bootstrap
Version: 0.3.0
Summary: Statistical Bootstrap with Pandas made easy
Project-URL: Homepage, https://williambdean.github.io/pandas-bootstrap/
Project-URL: Repository, https://github.com/williambdean/pandas-bootstrap
Project-URL: Documentation, https://williambdean.github.io/pandas-bootstrap/
Author-email: Will Dean <wd60622@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
Requires-Python: <4.0,>=3.9
Requires-Dist: joblib<2,>=1.1.1
Requires-Dist: pandas>=1.0.0
Requires-Dist: typing-extensions; python_version < '3.10'
Description-Content-Type: text/markdown

# Pandas Bootstrap

[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Tests](https://github.com/williambdean/pandas-bootstrap/actions/workflows/tests.yml/badge.svg)](https://github.com/williambdean/pandas-bootstrap/actions/workflows/tests.yml)
[![PyPI version](https://badge.fury.io/py/pandas-bootstrap.svg)](https://badge.fury.io/py/pandas-bootstrap)
[![docs](https://github.com/williambdean/pandas-bootstrap/actions/workflows/docs.yml/badge.svg)](https://williambdean.github.io/pandas-bootstrap/)
[![codecov](https://codecov.io/gh/williambdean/pandas-bootstrap/graph/badge.svg?token=WEJBSBMTYN)](https://codecov.io/gh/williambdean/pandas-bootstrap)

Statistical Bootstrap with Pandas made easy.

## Installation

```bash
pip install pandas-bootstrap
```

## Usage

The module is very easy to use.

1. `import bootstrap`
2. define statistic function: `def some_func(df: pd.DataFrame | pd.Series):`
3. get bootstrapped samples: `df.boot.get_samples(bfunc=some_func, B=100)`

Below is a simple example of bootstrapping the mean of two columns.

```python
import pandas as pd

import bootstrap

df = pd.DataFrame({
    'a': [1, 2, 3, 4, 5],
    'b': [6, 7, 8, 9, 10],
})

def mean_of_columns(df):
    return df.mean(numeric_only=True)

sample_kwargs = dict(random_state=42)
df_bootstrap = df.boot.get_samples(bfunc=mean_of_columns, B=5, sample_kwargs=sample_kwargs)
```

which results in:

```text
          a    b
sample
0       3.0  8.0
1       2.6  7.6
2       4.0  9.0
3       3.2  8.2
4       3.0  8.0
```

## Documentation

Read more in the [documentation](https://williambdean.github.io/pandas-bootstrap/)
