Skip to content

steviecurran/SQL2pandas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

SQL2pandas

Translate SQL queries into equivalent pandas operations.

Motivation

Many analysts are fluent in SQL but need to transition to Python data workflows.

Example

SQL:
SELECT country, AVG(revenue)
FROM sales
GROUP BY country;

Equivalent pandas:

df.groupby("country")["revenue"].mean()

Features

  • SQL SELECT / WHERE / GROUP BY equivalents
  • Translation helper functions
  • Examples for analysts moving to pandas

I suggest you download the Jupyter notebook and run it locally to get the full functionality (e.g. the table of contents) and let me know if there's anything you want added.

See https://github.com/steviecurran/sql2csv to convert .sql to .csv, via the C shell

About

Translate SQL queries into pandas operations for fast exploratory analysis and data transformation in Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors