

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
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.
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.
Run SQL in Jupyter To Analyze A Pandas DataFrame
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.