No project description provided
Project description
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
Installation
Install my-project with pip
pip install pandas_sqlite3
Example Use
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
Acknowledgements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pandas_sqlite3-0.1.0.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for pandas_sqlite3-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 192f066cc778aea6978e3c048a98e7324c1f23eafe1b589982595727cf3962c9 |
|
MD5 | a3d318b02d9c3c8ef2812e5f2815a885 |
|
BLAKE2b-256 | aa4862a58179b51777fcd1c6e6cc9dc7408a6964aee9c90ce38b0627d0491f8f |