<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/sources/dailydoseofds/best-of/2024" -->

---
title: Best Daily Dose of Data Science | Avi Chawla | Substack...
description: The most upvoted Daily Dose of Data Science | Avi Chawla | Substack posts of 2024, curated by the daily.dev community.
canonical: https://daily.dev/sources/dailydoseofds/best-of/2024
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:url: https://daily.dev/sources/dailydoseofds/best-of/2024
og:type: website
og:site_name: daily.dev
og:title: Best Daily Dose of Data Science | Avi Chawla | Substack posts of 2024 | daily.dev
og:description: The most upvoted Daily Dose of Data Science | Avi Chawla | Substack posts of 2024, curated by the daily.dev community.
og:image: https://media.daily.dev/image/upload/s--VAY5ToZt--/f_auto/v1724209435/public/daily.dev%20-%20open%20graph
---

# Best of Daily Dose of Data Science | Avi Chawla | Substack — 2024

1. 1  
[](/posts/15-ds-ml-cheat-sheets-g6vzxobqd "15 DS/ML Cheat Sheets")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Sep 22, 2024  
### 15 DS/ML Cheat Sheets  
This post collates 15 cheat sheets covering essential data science and machine learning concepts. It includes resources on translating between different data manipulation libraries, multi-GPU training strategies, testing ML models in production, neural network optimization, and more. Detailed links are provided for further reading.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/173e36e5921ab75a369f02f87bad8028?_a=AQAEuiZ)  
232  
1
2. 2  
[](/posts/building-a-100-local-mini-chatgpt-hbnmf1xcm "Building a 100% Local mini-ChatGPT")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • Dec 26, 2024  
### Building a 100% Local mini-ChatGPT  
A guide on building a local mini-ChatGPT app using the Llama3.2-vision model and Chainlit. The post includes a demo, necessary tools, and step-by-step coding instructions with multimodal prompting. The code and further resources for AI engineering are provided on GitHub.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/ef56bda5536ee8a9d27d48f6e24da306?_a=AQAEuj9)  
168  
4
3. 3  
[](/posts/20-most-common-magic-methods-ru2lmidxx "20 Most Common Magic Methods")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • Jun 16, 2024  
### 20 Most Common Magic Methods  
Discover the 20 most common magic methods used in Python OOP, including \_\_new\_\_, \_\_init\_\_, and \_\_str\_\_. Learn how to use these methods and their importance in Python projects.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/af8ee8b5da44f66d6bb8b75966bc2de4?_a=AQAEuiZ)  
146  
5
4. 4  
[](/posts/a-crash-course-on-building-rag-systems-part-4-sdq4a6xuj "A Crash Course on Building RAG Systems – Part 4")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Nov 27, 2024  
### A Crash Course on Building RAG Systems – Part 4  
Part 4 of the crash course on building RAG systems focuses on implementing RAG on multimodal data, specifically complex documents with tables, texts, and images. This series covers foundational components, evaluation methods, optimization techniques, and handling large data sets, making it highly beginner-friendly. Understanding how to build reliable RAG systems can reduce costs and enhance scalability for enterprises, bypassing the need for fine-tuning large language models (LLMs).

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/2427cb64e95d221a8457803965dfc5fa?_a=AQAEuj9)  
118
5. 5  
[](/posts/pandas-vs-fireducks-performance-comparison-vn1iuvctc "Pandas vs. FireDucks Performance Comparison")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • Nov 25, 2024  
### Pandas vs. FireDucks Performance Comparison  
FireDucks is a highly optimized alternative to Pandas, boasting a significant speed improvement through lazy execution. Users only need to replace their Pandas import with FireDucks. Benchmarks show FireDucks outperforming Pandas and other libraries like Modin and Polars, particularly in its speedy performance. The post provides instructions for installing FireDucks, using it in Jupyter Notebook, and integrating it into existing Python scripts.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/d12450df6926ca69174f603ddb65a7e3?_a=AQAEuj9)  
98  
2
6. 6  
[](/posts/rag-vs-agentic-rag-vbxygxvhs "RAG vs Agentic RAG")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
5m read time • Dec 20, 2024  
### RAG vs Agentic RAG  
Agentic RAG systems introduce dynamic, adaptable behaviors into the traditional RAG workflow. Unlike traditional RAG, which retrieves and generates once, agentic RAGs iteratively refine queries and context, adapting based on the problem's complexity. This makes them more effective for complex queries and problem-solving. The open-source tool Opik by CometML supports the evaluation, testing, and monitoring of LLM applications from development to production, offering features like logging traces and detecting hallucinations.

+5  
![Post Cover image](https://media.daily.dev/image/fetch/s--bSQImpY9--/f_auto,pg_1,q_auto/https://substackcdn.com/image/fetch/w_1200%2Ch_600%2Cc_fill%2Cf_jpg%2Cq_auto:good%2Cfl_progressive:steep%2Cg_auto/https%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F65bf97c3-6f3d-4fd8-810a-b335f8795239_1160x796.gif?_a=BAMAMiZY0)  
86
7. 7  
[](/posts/a-crash-course-on-rag-systems-part-5-x2w87ki6y "A crash course on RAG systems—Part 5")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • Dec 06, 2024  
### A crash course on RAG systems—Part 5  
Part 5 of the RAG crash course focuses on the implementation of key components for multimodal RAG systems, such as CLIP embeddings, multimodal prompting, and tool calling. The series aims to educate readers on building reliable RAG systems that can reduce costs and handle complex data types, ultimately aiding businesses in achieving greater impact.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/a4fb7a0d24b8e5d65fb15ff441c2176b?_a=AQAEuj9)  
83
8. 8  
[](/posts/25-most-important-mathematical-definitions-in-data-science-d87s83jjy "25 Most Important Mathematical Definitions in Data Science")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Apr 25, 2024  
### 25 Most Important Mathematical Definitions in Data Science  
The importance of mathematical knowledge in data science and machine learning, a list of important mathematical formulations used in data science and statistics, and the use of mean squared error (MSE) in machine learning.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/86f9191bbd8d0099db8c69fdc202b505?_a=AQAEuiZ)  
82
9. 9  
[](/posts/a-crash-course-on-graph-neural-networks-apztoi3gv "A Crash Course on Graph Neural Networks")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
2m read time • Aug 21, 2024  
### A Crash Course on Graph Neural Networks  
Graph Neural Networks (GNNs) extend deep learning techniques to graph data, addressing the limitations of traditional models in capturing complex relationships. This piece covers the basics, benefits, tasks, data challenges, frameworks, and practical implementation of GNNs.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/66da85ffc1f3f76ff50bc4a67ad0dc66?_a=AQAEuiZ)  
75
10. 10  
[](/posts/5-chunking-strategies-for-rag-5ymkcojcm "5 Chunking Strategies For RAG")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
6m read time • Oct 18, 2024  
### 5 Chunking Strategies For RAG  
Chunking is a critical step in designing a Retrieval-Augmented Generation (RAG) application as it enhances the efficiency and accuracy of the retrieval process. The post discusses five chunking strategies: fixed-size, semantic, recursive, document structure-based, and LLM-based chunking. Each method has its unique benefits and trade-offs, focusing on maintaining semantic integrity and computational efficiency. The choice of technique depends on document structure, model capabilities, and computational resources.

+5  
![Post Cover image](https://media.daily.dev/image/fetch/s--L_Gbg8IB--/f_auto,pg_1,q_auto/https://substackcdn.com/image/fetch/w_1200%2Ch_600%2Cc_fill%2Cf_jpg%2Cq_auto:good%2Cfl_progressive:steep%2Cg_auto/https%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F92c70184-ba0f-4877-9a55-e4add0e311ad_870x1116.gif?_a=BAMAMiZY0)  
74  
1
11. 11  
[](/posts/6-elegant-jupyter-hacks-6n1abykms "6 Elegant Jupyter Hacks")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • May 26, 2024  
### 6 Elegant Jupyter Hacks  
Discover 6 elegant Jupyter hacks to improve your experience. Learn how to retrieve a cell's output, enrich the default preview of a DataFrame, generate helpful hints as you write Pandas code, improve rendering of DataFrames, restart the Jupyter kernel without losing variables, and search code in all Jupyter Notebooks from the terminal.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/7c443fd88c804274d973e4c7fdffa893?_a=AQAEuiZ)  
65  
3
12. 12  
[](/posts/a-crash-course-on-rag-systems-part-6-xxkcqiazb "A crash course on RAG systems—Part 6")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • Dec 14, 2024  
### A crash course on RAG systems—Part 6  
Part 6 of the crash course on RAG systems explores how to build a more extensive and capable multimodal RAG system using CLIP embeddings, multimodal prompting, and tool calling. The post includes a unique dataset combining social media posts with images to provide a practical learning experience. The series covers everything from foundational components and evaluation to optimization and handling complex documents, aiming to help users implement reliable RAG systems and solve key NLP challenges with LLMs.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/b59160c7549215b8c77d9f12e341e9d8?_a=AQAEuj9)  
57
13. 13  
[](/posts/simplify-python-imports-with-explicit-packaging-2jwsndxr7 "Simplify Python Imports with Explicit Packaging")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
5m read time • Nov 21, 2024  
### Simplify Python Imports with Explicit Packaging  
Learn how to simplify your Python project imports by explicitly packaging your project with an \_\_init\_\_.py file. This method not only helps to avoid redundant imports but also allows you to specify which classes and functions can be imported from the package. The article explains the difference between modules, packages, and libraries, and provides a step-by-step guide on how to use \_\_init\_\_.py to streamline your code.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/c2adea5ba14e26881cc1ce7840437f18?_a=AQAEuj9)  
56  
1
14. 14  
[](/posts/building-a-rag-app-using-llama-3-3-7g6kopiu2 "Building a RAG app using Llama-3.3")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
2m read time • Dec 07, 2024  
### Building a RAG app using Llama-3.3  
Meta released Llama-3.3, and this post provides a hands-on demo for building a RAG app using it. The app allows users to interact with a document via chat. It uses LlamaIndex for orchestration, Qdrant for a self-hosted vector database, and Ollama for serving Llama-3.3 locally. The implementation steps include loading and parsing a knowledge base, creating embeddings, indexing and storing them, defining a custom prompt template, and setting up a query engine.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/2c6375a8b01af86551cdacdafbd99b1d?_a=AQAEuj9)  
48
15. 15  
[](/posts/4-ways-to-test-ml-models-in-production-f7zjv8aqg "4 Ways to Test ML Models in Production")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • Jun 21, 2024  
### 4 Ways to Test ML Models in Production  
Testing ML models in production is crucial to ensure reliability and performance on real-world data. Four common strategies are A/B testing, canary testing, interleaved testing, and shadow testing. A/B testing distributes requests non-uniformly between models, while canary testing gradually rolls out the candidate model to a subset of users. Interleaved testing mixes predictions from both models, and shadow testing logs outputs without affecting user experience. These techniques help mitigate risks and validate the model effectively.

+3  
![Post Cover image](https://media.daily.dev/image/fetch/s--WqWptLEC--/f_auto,pg_1,q_auto/https://substackcdn.com/image/fetch/w_1200%2Ch_600%2Cc_fill%2Cf_jpg%2Cq_auto:good%2Cfl_progressive:steep%2Cg_auto/https%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F9a8b694f-87c0-4109-937c-482a0eff6e37_1198x1092.gif?_a=BAMAMiZY0)  
46
16. 16  
[](/posts/a-simple-implementation-of-boosting-algorithm-jxlyyfb7x "A Simple Implementation of Boosting Algorithm")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Aug 12, 2024  
### A Simple Implementation of Boosting Algorithm  
Boosting is a machine learning technique where each successive model attempts to correct the errors of its predecessor, leading to improved performance. Key design choices include tree construction, loss function, and weighting of each tree's contribution. A step-by-step example using the Sklearn decision tree regressor shows how boosting works and the incremental improvement in R2 scores. Boosting algorithms are particularly significant for tabular data in machine learning.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/cf45ec7e27ca8110e24befd3ea765a1f?_a=AQAEuiZ)  
44
17. 17  
[](/posts/hands-on-building-a-llama-ocr-app-bdsdqopck "[Hands-on] Building a Llama-OCR app")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Dec 03, 2024  
### \[Hands-on\] Building a Llama-OCR app  
Learn how to build a Llama-OCR app using the Llama-3.2-vision model and Ollama for local serving. The app converts uploaded images into structured markdown. The post provides a step-by-step guide on downloading necessary tools and prompting the model. Code for the full app is available on GitHub.

+2  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/51427f58e25bcf4868a5c3cd05235d49?_a=AQAEuj9)  
42
18. 18  
[](/posts/hands-on-tool-calling-in-llms-f96hohnmg "[Hands-on] Tool calling in LLMs")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
2m read time • Dec 12, 2024  
### \[Hands-on\] Tool calling in LLMs  
Tool calling allows language models to perform specific tasks by invoking external tools or APIs. The process involves recognizing when an external tool is needed, invoking the tool, and integrating its output into the model's response. This enhances the flexibility and capability of LLMs. A demo is provided to build a stock price retrieval assistant using the yfinance library.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/a8eedcdd32c7980fac768d5016c44dfb?_a=AQAEuj9)  
41  
1
19. 19  
[](/posts/cpython-vs-cython-how-to-speed-up-native-python-programs-3sx0vaasg "CPython vs. Cython: How to Speed-up Native Python Programs")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
5m read time • Sep 02, 2024  
### CPython vs. Cython: How to Speed-up Native Python Programs  
Learn how Cython optimizes Python's performance by converting Python code into C, resulting in significant speed improvements and reduced memory overheads. The post contrasts CPython's lack of built-in optimization with Cython's ability to restrict Python’s dynamicity through explicit data typing. The guide includes practical steps for implementing Cython in a Jupyter Notebook to achieve over 100x speedup in code execution.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/d6480b90c26af2988bbeec718d9631b6?_a=AQAEuiZ)  
39  
2
20. 20  
[](/posts/9-python-command-line-flags-x14rcwtbk "9 Python Command Line Flags")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
6m read time • Jul 18, 2024  
### 9 Python Command Line Flags  
Discover the 9 most common Python command line flags and how they modify the behavior of the Python interpreter. This includes flags like \`-c\` for running commands directly in the command line, \`-i\` for entering interactive mode after script execution, and \`-O\` and \`-OO\` for optimizing code by ignoring assert statements and docstrings. Additional flags like \`-W\` for ignoring warnings, \`-m\` for running modules as scripts, \`-v\` for verbose mode, \`-x\` for skipping the first line of a script, and \`-E\` for ignoring Python environment variables are also covered.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/46e8647eea764d22d96151f20b27c5d8?_a=AQAEuiZ)  
38  
1
21. 21  
[](/posts/building-a-multi-agent-financial-analyst-pl6y3nqjk "Building a Multi-agent Financial Analyst")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Nov 28, 2024  
### Building a Multi-agent Financial Analyst  
The post demonstrates building a multi-agent financial analyst using Microsoft's Autogen and Llama3-70B. It outlines the tech stack, including the roles of code executor and code writer agents. The guide provides steps to set up the agents, execute code, and display stock analysis results. Additional resources and a GitHub repository for further exploration are also mentioned.

+3  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/195c6b6e1ae9fe22b355405b6948b1f4?_a=AQAEuj9)  
36
22. 22  
[](/posts/5-llm-fine-tuning-techniques-explained-visually-qtyfvdufy "5 LLM Fine-tuning Techniques Explained Visually")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
3m read time • May 30, 2024  
### 5 LLM Fine-tuning Techniques Explained Visually  
This post explains five fine-tuning techniques for LLMs, including LoRA, LoRA-FA, VeRA, Delta-LoRA, and LoRA+.

+2  
![Post Cover image](https://media.daily.dev/image/fetch/s--mUxnwSas--/f_auto,pg_1,q_auto/https://substackcdn.com/image/fetch/w_1200%2Ch_600%2Cc_fill%2Cf_jpg%2Cq_auto:good%2Cfl_progressive:steep%2Cg_auto/https%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252Fecdd1efc-9ab9-473e-b466-072507be8215_952x1102.gif?_a=BAMAMiZY0)  
36
23. 23  
[](/posts/our-agentic-workflow-to-write-and-publish-social-content-rx0j25sfr "Our Agentic Workflow to Write and Publish Social Content")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
2m read time • Dec 19, 2024  
### Our Agentic Workflow to Write and Publish Social Content  
A personal multi-agent app was developed to automate the creation and publication of social media content. The tech stack includes CrewAI for building workflows, FireCrawl for web scraping, and Typefully for post scheduling. The app processes content from a blog or newsletter, understands the writing style, and drafts posts for LinkedIn and X, publishing them via Typefully's API. Detailed insights and code are accessible in CrewAI's documentation.

+5  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/be27977b1f633fd2ad3b57db07caa4f2?_a=AQAEuj9)  
35  
1
24. 24  
[](/posts/16-popular-open-source-contributions-by-big-tech-1v1f19vob "16 Popular Open-source Contributions by Big Tech")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
6m read time • Nov 20, 2024  
### 16 Popular Open-source Contributions by Big Tech  
Big tech companies like Microsoft, Google, Meta, Yandex, and NVIDIA have significantly contributed to the machine learning ecosystem through various open-source projects. These contributions include Microsoft's DeepSpeed and ONNX, Google's TensorFlow and JAX, Meta's PyTorch and LLaMA, Yandex's CatBoost and ClickHouse, and NVIDIA's RAPIDS and TensorRT. Understanding these tools can help you tackle real-world problems efficiently.

+5  
![Post Cover image](https://media.daily.dev/image/fetch/s--5Tso3t9z--/f_auto,pg_1,q_auto/https://substackcdn.com/image/fetch/w_1200%2Ch_600%2Cc_fill%2Cf_jpg%2Cq_auto:good%2Cfl_progressive:steep%2Cg_auto/https%253A%252F%252Fsubstack-post-media.s3.amazonaws.com%252Fpublic%252Fimages%252F82605a67-375c-420c-943a-ecc8d3ebaf49_1220x1102.gif?_a=BAMAMiZY0)  
35  
1
25. 25  
[](/posts/grouping-sets-in-sql-ludgl5wdw "GROUPING SETS in SQL")  
[![dailydoseofds's profile](https://media.daily.dev/image/upload/s--4IHQgTOw--/f_auto/v1710503712/logos/dailydoseofds)](/sources/[source]/best-of/[year])  
4m read time • Jul 28, 2024  
### GROUPING SETS in SQL  
Learn how to efficiently run multiple aggregations in SQL using GROUPING SETS, which allows scanning the table just once. This method is more efficient compared to using UNION with separate queries. The post provides a detailed example and a link to a Jupyter Notebook for practical implementation.

+4  
![Post Cover image](https://media.daily.dev/image/upload/t_mobile_feed/v1/posts/38f543060171780a552e0b130368b039?_a=AQAEuiZ)  
35

[See all Daily Dose of Data Science | Avi Chawla | Substack archives](/sources/dailydoseofds/best-of)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@graph":[{"@type":"CollectionPage","@id":"https://daily.dev/sources/dailydoseofds/best-of/2024#page","url":"https://daily.dev/sources/dailydoseofds/best-of/2024","name":"Best Daily Dose of Data Science | Avi Chawla | Substack Posts of 2024","description":"The most upvoted Daily Dose of Data Science | Avi Chawla | Substack posts of 2024, curated by the daily.dev community.","isPartOf":{"@type":"WebSite","url":"https://daily.dev"}},{"@type":"ItemList","@id":"https://daily.dev/sources/dailydoseofds/best-of/2024#items","numberOfItems":25,"itemListElement":[{"@type":"ListItem","position":1,"url":"https://daily.dev/posts/15-ds-ml-cheat-sheets-g6vzxobqd","name":"15 DS/ML Cheat Sheets"},{"@type":"ListItem","position":2,"url":"https://daily.dev/posts/building-a-100-local-mini-chatgpt-hbnmf1xcm","name":"Building a 100% Local mini-ChatGPT"},{"@type":"ListItem","position":3,"url":"https://daily.dev/posts/20-most-common-magic-methods-ru2lmidxx","name":"20 Most Common Magic Methods"},{"@type":"ListItem","position":4,"url":"https://daily.dev/posts/a-crash-course-on-building-rag-systems-part-4-sdq4a6xuj","name":"A Crash Course on Building RAG Systems – Part 4"},{"@type":"ListItem","position":5,"url":"https://daily.dev/posts/pandas-vs-fireducks-performance-comparison-vn1iuvctc","name":"Pandas vs. FireDucks Performance Comparison"},{"@type":"ListItem","position":6,"url":"https://daily.dev/posts/rag-vs-agentic-rag-vbxygxvhs","name":"RAG vs Agentic RAG"},{"@type":"ListItem","position":7,"url":"https://daily.dev/posts/a-crash-course-on-rag-systems-part-5-x2w87ki6y","name":"A crash course on RAG systems—Part 5"},{"@type":"ListItem","position":8,"url":"https://daily.dev/posts/25-most-important-mathematical-definitions-in-data-science-d87s83jjy","name":"25 Most Important Mathematical Definitions in Data Science"},{"@type":"ListItem","position":9,"url":"https://daily.dev/posts/a-crash-course-on-graph-neural-networks-apztoi3gv","name":"A Crash Course on Graph Neural Networks"},{"@type":"ListItem","position":10,"url":"https://daily.dev/posts/5-chunking-strategies-for-rag-5ymkcojcm","name":"5 Chunking Strategies For RAG"},{"@type":"ListItem","position":11,"url":"https://daily.dev/posts/6-elegant-jupyter-hacks-6n1abykms","name":"6 Elegant Jupyter Hacks"},{"@type":"ListItem","position":12,"url":"https://daily.dev/posts/a-crash-course-on-rag-systems-part-6-xxkcqiazb","name":"A crash course on RAG systems—Part 6"},{"@type":"ListItem","position":13,"url":"https://daily.dev/posts/simplify-python-imports-with-explicit-packaging-2jwsndxr7","name":"Simplify Python Imports with Explicit Packaging"},{"@type":"ListItem","position":14,"url":"https://daily.dev/posts/building-a-rag-app-using-llama-3-3-7g6kopiu2","name":"Building a RAG app using Llama-3.3"},{"@type":"ListItem","position":15,"url":"https://daily.dev/posts/4-ways-to-test-ml-models-in-production-f7zjv8aqg","name":"4 Ways to Test ML Models in Production"},{"@type":"ListItem","position":16,"url":"https://daily.dev/posts/a-simple-implementation-of-boosting-algorithm-jxlyyfb7x","name":"A Simple Implementation of Boosting Algorithm"},{"@type":"ListItem","position":17,"url":"https://daily.dev/posts/hands-on-building-a-llama-ocr-app-bdsdqopck","name":"[Hands-on] Building a Llama-OCR app"},{"@type":"ListItem","position":18,"url":"https://daily.dev/posts/hands-on-tool-calling-in-llms-f96hohnmg","name":"[Hands-on] Tool calling in LLMs"},{"@type":"ListItem","position":19,"url":"https://daily.dev/posts/cpython-vs-cython-how-to-speed-up-native-python-programs-3sx0vaasg","name":"CPython vs. Cython: How to Speed-up Native Python Programs"},{"@type":"ListItem","position":20,"url":"https://daily.dev/posts/9-python-command-line-flags-x14rcwtbk","name":"9 Python Command Line Flags"},{"@type":"ListItem","position":21,"url":"https://daily.dev/posts/building-a-multi-agent-financial-analyst-pl6y3nqjk","name":"Building a Multi-agent Financial Analyst"},{"@type":"ListItem","position":22,"url":"https://daily.dev/posts/5-llm-fine-tuning-techniques-explained-visually-qtyfvdufy","name":"5 LLM Fine-tuning Techniques Explained Visually"},{"@type":"ListItem","position":23,"url":"https://daily.dev/posts/our-agentic-workflow-to-write-and-publish-social-content-rx0j25sfr","name":"Our Agentic Workflow to Write and Publish Social Content"},{"@type":"ListItem","position":24,"url":"https://daily.dev/posts/16-popular-open-source-contributions-by-big-tech-1v1f19vob","name":"16 Popular Open-source Contributions by Big Tech"},{"@type":"ListItem","position":25,"url":"https://daily.dev/posts/grouping-sets-in-sql-ludgl5wdw","name":"GROUPING SETS in SQL"}]},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Sources","item":"https://daily.dev/sources"},{"@type":"ListItem","position":3,"name":"Daily Dose of Data Science | Avi Chawla | Substack","item":"https://daily.dev/sources/dailydoseofds"},{"@type":"ListItem","position":4,"name":"Best of","item":"https://daily.dev/sources/dailydoseofds/best-of"},{"@type":"ListItem","position":5,"name":"2024"}]}]}
```

