Skip to main content

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

MIT

Acknowledgements

Project details


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_sqlite3-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file pandas_sqlite3-0.1.0.tar.gz.

File metadata

  • Download URL: pandas_sqlite3-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pandas_sqlite3-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a404bdd01eb87a78ce6bc43763bcc00fba6fd3520cf732750a8a540098d74c63
MD5 04baa3da70f0f4ef61b93dc4049c6b06
BLAKE2b-256 132d01553d7e29fafcf008e681865742a1fcfea4037cb5ef9e1e4072187ef499

See more details on using hashes here.

File details

Details for the file pandas_sqlite3-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pandas_sqlite3-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.13

File hashes

Hashes for pandas_sqlite3-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 192f066cc778aea6978e3c048a98e7324c1f23eafe1b589982595727cf3962c9
MD5 a3d318b02d9c3c8ef2812e5f2815a885
BLAKE2b-256 aa4862a58179b51777fcd1c6e6cc9dc7408a6964aee9c90ce38b0627d0491f8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page