# Pandas Sqlite3
This project is to simplify the joining of pandas dataframes using Sqlite3.
In the world of data science there are often two camps 1)Pandas and 2)SQL.
We want to bring these worlds together by making it easier for those more
familiar with SQL to manipulate Pandas dataframes within python. With Pandas Sqlite3
one can simply pass a list of Pandas dataframes, their names, and a Sqlite3 statement
to be executed. Enjoy :)
## Authors
- [Hamilton Noel](https://www.github.com/noelham)
## Installation
Install my-project with pip
```bash
pip install pandas_sqlite3
```
## Example Use
```python
import pandas as pd
from pandas_sqlite3.pandas_query import pandas_query
# create dataframes
sample_df = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv')
long_petal_df = sample_df.loc[sample_df['petal_length'] > 5].copy()
# write sql query
sql_query = """
SELECT
S.*
FROM sample_df s
JOIN long_petal_df USING ('sepal_length', 'sepal_width', 'petal_length', 'petal_width', 'species')
"""
# pass dataframes, their names, and SQL query to pandas_query function
final_df = pandas_query(dfs=[sample_df, long_petal_df], df_names=['sample_df', 'long_petal_df'], sql=sql_query)
```
## Contributing
Contributions are always welcome!
## License
[MIT](https://choosealicense.com/licenses/mit/)
## Acknowledgements
- [Awesome Readme Templates](https://awesomeopensource.com/project/elangosundar/awesome-README-templates)
- [Python Package to PyPI Using Poetry](https://towardsdatascience.com/how-to-effortlessly-publish-your-python-package-to-pypi-using-poetry-44b305362f9f)
pandas_sqlite3-0.1.0.tar.gz
需积分: 1 97 浏览量
2024-03-17
13:27:44
上传
评论
收藏 3KB GZ 举报
程序员Chino的日记
- 粉丝: 2913
- 资源: 4万+
最新资源
- 1716894470778.jpg
- cocosCreator2.x版本中在编辑器里实时显示spine预览
- JAVA办公自动化系统(源代码)
- mysql-8.0.30-winx64 + mysql可视化查看工具.zip
- CFC80266-B758-40DA-8899-6A73679949AD.rar
- 异构数据库迁移同步(搬家)工具.zip
- 一款支持 KV 数据和时序数据的超轻量级数据库.zip
- 一个基于 bitcask 模型的 NoSQL 数据库,支持多种数据结构 .zip
- Python 拼图游戏,使用python编写实现拼图游戏
- 搜索链接java(结合lucene)版的公交搜索系统-javaso
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈