# pandas-plots
![PyPI - Version](https://img.shields.io/pypi/v/pandas-plots) ![GitHub last commit](https://img.shields.io/github/last-commit/smeisegeier/pandas-plots?logo=github) ![GitHub License](https://img.shields.io/github/license/smeisegeier/pandas-plots?logo=github) ![py3.10](https://img.shields.io/badge/python-3.10-blue.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICA8ZGVmcz4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0icHlZZWxsb3ciIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2ZlNSIgb2Zmc2V0PSIwLjYiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI2RhMSIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJweUJsdWUiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDUpIj4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzY5ZiIgb2Zmc2V0PSIwLjQiLz4KICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iIzQ2OCIgb2Zmc2V0PSIxIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogIDwvZGVmcz4KCiAgPHBhdGggZD0iTTI3LDE2YzAtNyw5LTEzLDI0LTEzYzE1LDAsMjMsNiwyMywxM2wwLDIyYzAsNy01LDEyLTExLDEybC0yNCwwYy04LDAtMTQsNi0xNCwxNWwwLDEwbC05LDBjLTgsMC0xMy05LTEzLTI0YzAtMTQsNS0yMywxMy0yM2wzNSwwbDAtM2wtMjQsMGwwLTlsMCwweiBNODgsNTB2MSIgZmlsbD0idXJsKCNweUJsdWUpIi8+CiAgPHBhdGggZD0iTTc0LDg3YzAsNy04LDEzLTIzLDEzYy0xNSwwLTI0LTYtMjQtMTNsMC0yMmMwLTcsNi0xMiwxMi0xMmwyNCwwYzgsMCwxNC03LDE0LTE1bDAtMTBsOSwwYzcsMCwxMyw5LDEzLDIzYzAsMTUtNiwyNC0xMywyNGwtMzUsMGwwLDNsMjMsMGwwLDlsMCwweiBNMTQwLDUwdjEiIGZpbGw9InVybCgjcHlZZWxsb3cpIi8+CgogIDxjaXJjbGUgcj0iNCIgY3g9IjY0IiBjeT0iODgiIGZpbGw9IiNGRkYiLz4KICA8Y2lyY2xlIHI9IjQiIGN4PSIzNyIgY3k9IjE1IiBmaWxsPSIjRkZGIi8+Cjwvc3ZnPgo=)
## usage
install / update package
```bash
pip install pandas-plots -U
```
include in python
```python
from pandas_plots import tbl, plt, ven
```
## example
```python
# load sample dataset from seaborn
import seaborn as sb
df = sb.load_dataset('taxis')
plt.plot_box(df['fare'], height=400, violin=True)
```
![plot_box](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-13-00-40-27.png?raw=true)
## why use pandas-plots
`pandas-plots` is a package to help you examine and visualize data that are organized in a pandas DataFrame. It provides a high level api to pandas / plotly with some selected functions.
It is subdivided into:
- `tbl` utilities for table descriptions
- `describe_df()` an alternative version of pandas `describe()` function
- `pivot_df()` gets a pivot table of a 3 column dataframe
- `plt` for plotly visualizations
- `plot_box()` auto annotated boxplot w/ violin option
- `plot_boxes()` multiple boxplots _(annotation is experimental)_
- `plots_bars()` a standardized bar plot
- `plot_stacked_bars()` shortcut to stacked bars ����
- `plot_quadrants()` quickly shows a 2x2 heatmap
- `ven` offers functions for _venn diagrams_
- `show_venn2()` displays a venn diagram for 2 sets
- `show_venn3()` displays a venn diagram for 3 sets
- `sql` is added as convienience wrapper for retrieving data from sql databases
- `connect_sql` get data from `['mssql', 'sqlite','postgres']`
## more examples
```python
# quick and exhaustive description of any table
tbl.describe_df(df, 'taxis', top_n_uniques=5)
```
![describe_df](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-14-20-49-00.png?raw=true)
```python
# show pivoted values for selected columns
tbl.pivot_df(df[['color', 'payment', 'fare']])
```
![pivot_df](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-14-20-45-45.png?raw=true)
```python
# show venn diagram for 3 sets
from pandas_plots import ven
set_a = set(df.pickup_zone)
set_b = set(df.dropoff_zone)
set_c = set(df['pickup_borough'])
_df, _details = ven.show_venn3(
"taxis",
set_a,
"pick",
set_b,
"drop",
c_set=set_c,
c_label="borough",
verbose=0,
size=8,
)
```
![venn](https://github.com/smeisegeier/pandas-plots/blob/main/img/2024-02-17-11-43-46.png?raw=true)
## dependencies
pandas-plots-0.8.0.tar.gz
需积分: 1 67 浏览量
2024-03-07
12:45:48
上传
评论
收藏 19KB GZ 举报
程序员Chino的日记
- 粉丝: 2735
- 资源: 3万+
最新资源
- 基于matlab实现恒模算法的简介,它适用于信道的盲均衡 Matlab程序提供基本的框架,可以修该里面的参数以测试该算法.rar
- 基于C# WinForm框架开发的图书管理系统源码+sql文件.zip
- 基于matlab实现快速样本熵算法,能够提高5倍,数据长度越长,提高越明显.rar
- 基于matlab实现频谱分析,用于对等时间间距的序列进行频谱分析.rar
- 基于matlab实现实现了基于项目的协同过滤代码,MATLAB实现.rar
- 华为 OD 机考攻略-加强版
- 大学生竞赛平台源代码 springboot
- 基于VS+QT开发的FTP服务器源码+项目说明.zip
- 基于matlab实现心电信号预处理 滤波 去噪 QRs波检测 P波,T波检测.rar
- 华为 OD 机考攻略-加强版
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈