sqldf for pandas
pandasql allows you to query pandas DataFrames using SQL syntax. It works
similarly to sqldf in R. pandasql seeks to provide a more familiar way of
manipulating and cleaning data for people new to Python or pandas.
$ pip install -U pandasql
The main function used in pandasql is sqldf. sqldf accepts 2 parametrs
locals() or globals())Specifying locals() or globals() can get tedious. You can define a short
helper function to fix this.
from pandasql import sqldf
pysqldf = lambda q: sqldf(q, globals())
pandasql uses SQLite syntax. Any pandas
dataframes will be automatically detected by pandasql. You can query them as
you would any regular SQL table.
…
joins and aggregations are also supported
…
More information and code samples available in the examples folder or on our blog.
No open issues yet, or sync has not completed.