Python | Towards Data Science https://towardsdatascience.com/tag/python/ Publish AI, ML & data-science insights to a global community of data professionals. Mon, 15 Dec 2025 18:28:04 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.3 https://towardsdatascience.com/wp-content/uploads/2025/02/cropped-Favicon-32x32.png Python | Towards Data Science https://towardsdatascience.com/tag/python/ 32 32 Geospatial exploratory data analysis with GeoPandas and DuckDB https://towardsdatascience.com/geospatial-exploratory-data-analysis-with-geopandas-and-duckdb/ Mon, 15 Dec 2025 13:17:00 +0000 https://towardsdatascience.com/?p=607897 In this article, I’ll show you how to use two popular Python libraries to carry out some geospatial analysis of traffic accident data within the UK. I was a relatively early adopter of DuckDB, the fast OLAP database, after it became available, but only recently realised that, through an extension, it offered a large number […]

The post Geospatial exploratory data analysis with GeoPandas and DuckDB appeared first on Towards Data Science.

]]>
Stop Writing Spaghetti if-else Chains: Parsing JSON with Python’s match-case https://towardsdatascience.com/stop-writing-spaghetti-if-else-chains-parsing-json-with-pythons-match-case/ Sun, 14 Dec 2025 10:24:00 +0000 https://towardsdatascience.com/?p=607903 Introduction If you work in data science, data engineering, or as as a frontend/backend developer, you deal with JSON. For professionals, its basically only death, taxes, and JSON-parsing that is inevitable. The issue is that parsing JSON is often a serious pain. Whether you are pulling data from a REST API, parsing logs, or reading […]

The post Stop Writing Spaghetti if-else Chains: Parsing JSON with Python’s match-case appeared first on Towards Data Science.

]]>
EDA in Public (Part 1): Cleaning and Exploring Sales Data with Pandas https://towardsdatascience.com/eda-in-public-part-1-cleaning-exploring-sales-data-with-pandas/ Fri, 12 Dec 2025 13:20:00 +0000 https://towardsdatascience.com/?p=607886 Hey everyone! Welcome to the start of a major data journey that I’m calling “EDA in Public.” For those who know me, I believe the best way to learn anything is to tackle a real-world problem and share the entire messy process — including mistakes, victories, and everything in between. If you’ve been looking to level up […]

The post EDA in Public (Part 1): Cleaning and Exploring Sales Data with Pandas appeared first on Towards Data Science.

]]>
Drawing Shapes with the Python Turtle Module https://towardsdatascience.com/drawing-shapes-with-the-python-turtle-module/ Thu, 11 Dec 2025 15:00:00 +0000 https://towardsdatascience.com/?p=607880 A step-by-step tutorial that explores the Python Turtle Module

The post Drawing Shapes with the Python Turtle Module appeared first on Towards Data Science.

]]>
7 Pandas Performance Tricks Every Data Scientist Should Know https://towardsdatascience.com/7-pandas-performance-tricks-every-data-scientist-should-know/ Thu, 11 Dec 2025 13:30:00 +0000 https://towardsdatascience.com/?p=607878 What I've learned about making Pandas faster after too many slow notebooks and frozen sessions

The post 7 Pandas Performance Tricks Every Data Scientist Should Know appeared first on Towards Data Science.

]]>
YOLOv1 Paper Walkthrough: The Day YOLO First Saw the World https://towardsdatascience.com/yolov1-paper-walkthrough-the-day-yolo-first-saw-the-world/ Fri, 05 Dec 2025 14:00:00 +0000 https://towardsdatascience.com/?p=607816 A detailed walkthrough of the YOLOv1 architecture and its PyTorch implementation from scratch

The post YOLOv1 Paper Walkthrough: The Day YOLO First Saw the World appeared first on Towards Data Science.

]]>
Build and Deploy Your First Supply Chain App in 20 Minutes https://towardsdatascience.com/build-and-deploy-your-first-supply-chain-app-in-20-minutes/ Thu, 04 Dec 2025 15:00:00 +0000 https://towardsdatascience.com/?p=607808 A factory operator that discovered happiness by switching from notebook to streamlit - (Image Generated with GPT-5.1 by Samir Saci)

The post Build and Deploy Your First Supply Chain App in 20 Minutes appeared first on Towards Data Science.

]]>
Bootstrap a Data Lakehouse in an Afternoon https://towardsdatascience.com/bootstrap-a-data-lakehouse-in-an-afternoon/ Thu, 04 Dec 2025 13:30:00 +0000 https://towardsdatascience.com/?p=607806 Using Apache Iceberg on AWS with Athena, Glue/Spark and DuckDB

The post Bootstrap a Data Lakehouse in an Afternoon appeared first on Towards Data Science.

]]>
JSON Parsing for Large Payloads: Balancing Speed, Memory, and Scalability https://towardsdatascience.com/json-parsing-for-large-payloads-balancing-speed-memory-and-scalability/ Tue, 02 Dec 2025 15:30:00 +0000 https://towardsdatascience.com/?p=607786 Benchmarking JSON libraries for large payloads

The post JSON Parsing for Large Payloads: Balancing Speed, Memory, and Scalability appeared first on Towards Data Science.

]]>
How to Use Simple Data Contracts in Python for Data Scientists https://towardsdatascience.com/how-to-use-simple-data-contracts-in-python-for-data-scientists/ Tue, 02 Dec 2025 14:00:00 +0000 https://towardsdatascience.com/?p=607784 Stop your pipelines from breaking on Friday afternoons using simple, open-source validation with Pandera.

The post How to Use Simple Data Contracts in Python for Data Scientists appeared first on Towards Data Science.

]]>
How to Generate QR Codes in Python https://towardsdatascience.com/how-to-generate-qr-code-in-python/ Tue, 02 Dec 2025 12:30:00 +0000 https://towardsdatascience.com/?p=607782 A beginner-friendly tutorial exploring the Python "qrcode" Package

The post How to Generate QR Codes in Python appeared first on Towards Data Science.

]]>
Learning, Hacking, and Shipping ML https://towardsdatascience.com/learning-hacking-and-shipping-ml/ Mon, 01 Dec 2025 15:22:11 +0000 https://towardsdatascience.com/?p=607707 Vyacheslav Efimov on AI hackathons, data science roadmaps, and how AI meaningfully changed day-to-day ML Engineer work

The post Learning, Hacking, and Shipping ML appeared first on Towards Data Science.

]]>
Implementing the Rock Paper Scissors Game in Python https://towardsdatascience.com/implementing-the-rock-paper-scissors-game-in-python/ Thu, 27 Nov 2025 12:30:00 +0000 https://towardsdatascience.com/?p=607740 A beginner-friendly Python tutorial using conditionals and the random module

The post Implementing the Rock Paper Scissors Game in Python appeared first on Towards Data Science.

]]>
How to Implement Randomization with the Python Random Module https://towardsdatascience.com/implementing-randomisation-with-the-python-random-module/ Mon, 24 Nov 2025 21:30:00 +0000 https://towardsdatascience.com/?p=607724 Let's generate randomness in our code’s outputs

The post How to Implement Randomization with the Python Random Module appeared first on Towards Data Science.

]]>
A Hands-On Guide to Anthropic’s New Structured Output Capabilities https://towardsdatascience.com/hands-on-with-anthropics-new-structured-output-capabilities/ Mon, 24 Nov 2025 19:51:37 +0000 https://towardsdatascience.com/hands-on-with-anthropics-new-structured-output-capabilities/ A developer’s guide to perfect JSON and typed outputs from Claude Sonnet 4.5 and Opus 4.1

The post A Hands-On Guide to Anthropic’s New Structured Output Capabilities appeared first on Towards Data Science.

]]>
LLM-as-a-Judge: What It Is, Why It Works, and How to Use It to Evaluate AI Models https://towardsdatascience.com/llm-as-a-judge-what-it-is-why-it-works-and-how-to-use-it-to-evaluate-ai-models/ Mon, 24 Nov 2025 19:33:31 +0000 https://towardsdatascience.com/?p=607718 A step-by-step guide to building AI quality control using large language models

The post LLM-as-a-Judge: What It Is, Why It Works, and How to Use It to Evaluate AI Models appeared first on Towards Data Science.

]]>
Empirical Mode Decomposition: The Most Intuitive Way to Decompose Complex Signals and Time Series https://towardsdatascience.com/preprocessing-signal-data-with-empirical-mode-decomposition/ Sat, 22 Nov 2025 15:00:00 +0000 https://towardsdatascience.com/?p=607709 A step-by-step breakdown of empirical mode decomposition to help you extract patterns from time series

The post Empirical Mode Decomposition: The Most Intuitive Way to Decompose Complex Signals and Time Series appeared first on Towards Data Science.

]]>
Modern DataFrames in Python: A Hands-On Tutorial with Polars and DuckDB https://towardsdatascience.com/modern-dataframes-in-python-a-hands-on-tutorial-with-polars-and-duckdb/ Fri, 21 Nov 2025 17:00:00 +0000 https://towardsdatascience.com/?p=607702 How I learned to handle growing datasets without slowing down my entire workflow

The post Modern DataFrames in Python: A Hands-On Tutorial with Polars and DuckDB appeared first on Towards Data Science.

]]>
Data Visualization Explained (Part 5): Visualizing Time-Series Data in Python (Matplotlib, Plotly, and Altair) https://towardsdatascience.com/data-visualization-explained-part-5-visualizing-time-series-data-in-python-matplotlib-plotly-and-altair/ Thu, 20 Nov 2025 15:30:00 +0000 https://towardsdatascience.com/?p=607688 An explanation of time-series visualization, including in-depth code examples in Matplotlib, Plotly, and Altair.

The post Data Visualization Explained (Part 5): Visualizing Time-Series Data in Python (Matplotlib, Plotly, and Altair) appeared first on Towards Data Science.

]]>
Why I’m Making the Switch to marimo Notebooks https://towardsdatascience.com/why-im-making-the-switch-to-marimo-notebooks/ Thu, 20 Nov 2025 12:30:00 +0000 https://towardsdatascience.com/?p=607684 A fresh way to think about computational notebooks

The post Why I’m Making the Switch to marimo Notebooks appeared first on Towards Data Science.

]]>