Daily Dose of Data Science

Share this post

Run SQL in Jupyter To Analyze A Pandas DataFrame

www.blog.dailydoseofds.com

Discover more from Daily Dose of Data Science

High-quality insights on Data Science and Python, along with best practices — shared daily. Get a free 550+ page data science PDF guide and 450+ practice questions notebook.
Over 50,000 subscribers
Continue reading
Sign in

Run SQL in Jupyter To Analyze A Pandas DataFrame

Avi Chawla
Dec 21, 2022
1
Share this post

Run SQL in Jupyter To Analyze A Pandas DataFrame

www.blog.dailydoseofds.com
2
Share

Pandas already provides a wide range of functionalities to analyze tabular data. Yet, there might be situations when one feels comfortable using SQL over Python.

Using DuckDB, you can analyze a Pandas DataFrame with SQL syntax in Jupyter, without any significant run-time difference.

Read the guide here to get started: Docs.

Thanks for reading Daily Dose of Data Science! Subscribe for free to learn something new about Python and Data Science every day.


Find the code for my tips here: GitHub.

I like to explore, experiment and write about data science concepts and tools. You can read my articles on Medium. Also, you can connect with me on LinkedIn.

1
Share this post

Run SQL in Jupyter To Analyze A Pandas DataFrame

www.blog.dailydoseofds.com
2
Share
Previous
Next
2 Comments
Share this discussion

Run SQL in Jupyter To Analyze A Pandas DataFrame

www.blog.dailydoseofds.com
André Mejia Grijó
Feb 14

Awesome tips man! But this one can be done with raw function called "query". You can easily select anything from your df with df.query("city == yourcity), specify variables or even functions.

Expand full comment
Reply
Share
1 reply by Avi Chawla
1 more comment...
Top
New
Community

No posts

Ready for more?

© 2023 Avi Chawla
Privacy ∙ Terms ∙ Collection notice
Start WritingGet the app
Substack is the home for great writing