semvec/pypi-packages huggingface dataset:
plottah 1.3.2
Plottah: Univariate Analysis
Requires Python: <4.0,>=3.11

*Copyright © 2024 by Boston Consulting Group. All rights reserved*
# SmartBanking Plotting tool

A Python package for generating standardized univariate analysis plots and visualizations for SmartBanking analysis. The package automatically generates:
- ROC curves
- Distribution plots
- Bin event rate plots

## Installation

There are two ways to use this package:

### 1. Install from PyPI (Recommended)

If you just want to use the package as a library:

```shell
pip install plottah
```

### 2. Local Development with Config (For Batch Processing)

If you want to process multiple features using a configuration file:

1. Clone the repository:
```shell
git clone git@github.com:nielsota/plottah.git
cd plottah
```

2. Install Poetry (if you haven't already):
```shell
curl -sSL https://install.python-poetry.org | python3 -
```

3. Install dependencies and set up the development environment:
```shell
poetry install
```

## Usage

### As a Python Package

```python
from plottah import build_univariate_plot
import pandas as pd

# Create your dataframe
df = pd.DataFrame(...)

# Generate a single plot
plot = build_univariate_plot(
    df=df,
    feature_col="your_feature",
    target="target_column",
    feature_type="numerical",  # or "categorical"
    n_bins=10,  # optional
    distplot_q_min=0.01,  # optional
    distplot_q_max=0.99   # optional
)
```

### Using Configuration File

1. Create a `config.yaml` file with your settings:
```yaml
file_path: ./data/your_data.csv
images_output_path: ./data/images
powerpoint_output_path: ./data/powerpoints/output.pptx

features:
  - name: feature_1
    n_bins: 10
  - name: feature_2
    bins: [0, 1, 5, 10, 100]
  - name: feature_3
    type: categorical

target: target_column

# Optional: Custom colors
primary_color: 231, 30, 87
secondary_color: 153, 204, 235
tertiary_color: 254, 189, 64
grey_tint_color: 110, 111, 115
```

2. Run the plotting tool:
```shell
poetry run python -m plottah
```

## Configuration Options

For each feature in the config file, you can specify:
- `name`: Feature column name (required)
- `type`: "numerical" or "categorical" (default: "numerical")
- `n_bins`: Number of bins for numerical features
- `bins`: Custom bin edges for numerical features
- `distplot_q_min`: Lower quantile for distribution plot trimming
- `distplot_q_max`: Upper quantile for distribution plot trimming

## Examples

See the `notebooks/` directory for detailed examples of:
- Basic univariate analysis
- Custom binning strategies
- Distribution plot customization
- ROC curve analysis

## Requirements

* Python >=3.8
* Poetry for development setup
Dossenge 0.7
Dossenge 0.7
Requires Python: >=3.5

# Dossenge - 一个包含很常用功能的Python库


## 项目介绍
Dossenge 是一个为 Python 开发者设计的实用工具库，旨在提供一些常用的功能，帮助开发者快速解决问题。这个库特别适合初学者和需要快速实现某些功能的开发者。

## 主模块

### 方法列表

**引入方法：**
`from Dossenge import Dossenge as Dossenge`或`from Dossenge.Dossenge import *`

**方法列表：**
```python
Dossenge.equal(x, y, roundnum=3) # 判断x与y的差是否小于10**-roundnum（精度影响，可自行设置精度）
Dossenge.chicken_rabbit(head, foot) # 计算鸡兔同笼问题，head个头，foot条腿 返回[(chicken,rabbit)]
Dossenge.fibonacci(number) #计算斐波那契数列的第number项
```

## 字符串处理

**引入Dossenge.string方法：**
`from Dossenge import string`或`from Dossenge.string import *`

**方法列表：**
```python
Dossenge.string.String # 类： 目前没有用处，敬请期待
Dossenge.string.countstr(string) # 以字典形式返回字符串中字符的个数
Dossenge.string.save_add(filepath,string) # 往filepath文件中增加写入string然后返回新的内容
```

## HTTP 请求

**引入方法：** `from Dossenge.http import *`

**方法列表：**
```python
Dossenge.http.header_request(url, **headers) # 发送带有自定义请求头的 HTTP 请求
```

**示例：**

```python
from Dossenge.http import header_request

# 自定义请求头
headers = {
    "User-Agent": "MyApp/1.0",
    "Authorization": "Bearer mytoken",
    "Accept": "application/json"
}

# 发送请求
response = header_request("https://api.example.com/data", **headers)

# 打印响应内容
if response:
    print(response.json())
	
```

## 进度条

**引入方法：** `from Dossenge.progress import *`

**方法列表：**
```python
Dossenge.progress.progress(start, end, timer, progresses) # 发送带有自定义请求头的 HTTP 请求
# progresses参数是一个列表，代表每走1格执行的Python代码
```


## 可执行文件
```bash
dossenge equal 0.1+0.2 0.3 5
```
判断x与y的差是否小于10\*\*-5

```bash
dossenge cr head foot
```
解决鸡兔同笼问题

*配置文件：（已弃用）*
*config.toml*
*lang 文件名*
*path 文件路径*
*ext 扩展名*

*可自定义语言包（已弃用）*
*格式为*
*"*
*判断两数是否相等*
*解决鸡兔同笼问题*
*"*