Daily Dose of Data Science

Share this post

Run SQL in Jupyter To Analyze A Pandas DataFrame

www.blog.dailydoseofds.com

Run SQL in Jupyter To Analyze A Pandas DataFrame

Avi Chawla
Dec 21, 2022
1
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
2
Share
Previous
Next
2 Comments
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
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