News
GeoPandas Basics: Maps, Projections, and Spatial Joins – Real Python
3+ hour, 22+ min ago (1795+ words) GeoPandas extends pandas to make working with geospatial data in Python intuitive and powerful. If you're looking to do geospatial tasks in Python and want a library with a pandas-like API, then GeoPandas is an excellent choice. This tutorial shows…...
LlamaIndex in Python: A RAG Guide With Examples
1+ mon, 2+ day ago (1783+ words) Discover how to use LlamaIndex with practical examples. This framework helps you build retrieval-augmented generation (RAG) apps using Python. LlamaIndex lets you load your data and documents, create and persist searchable indexes, and query an LLM using your data as…...
Writing DataFrame-Agnostic Python Code With Narwhals – Real Python
1+ mon, 1+ week ago (1783+ words) Narwhals is intended for Python library developers who need to analyze DataFrames in a range of standard formats, including Polars, pandas, DuckDB, and others. It does this by providing a compatibility layer of code that handles any differences between the…...
Python Inner Functions: What Are They Good For? – Real Python
1+ mon, 2+ week ago (1776+ words) Python inner functions are those you define inside other functions to access nonlocal names and bundle logic with its surrounding state. In this tutorial, you'll learn how to create inner helper functions, build closures that retain state across calls, and…...
Introduction to pandas – Real Python
1+ mon, 3+ week ago (127+ words) The pandas DataFrame is a structure that contains two-dimensional data and its corresponding labels. DataFrames are widely used in data science, machine learning, scientific computing, and many other data-intensive fields. DataFrames are similar to SQL tables or the spreadsheets that…...
Using Python Optional Arguments When Defining Functions – Real Python
2+ mon, 4+ week ago (1844+ words) Defining your own functions is an essential skill for writing clean and effective code. Once you master Python's optional arguments, you'll be able to define functions that are more powerful and more flexible. To get the most out of this…...
Polars vs pandas: What's the Difference? – Real Python
3+ mon, 1+ week ago (1812+ words) To get the most out of this tutorial, it's recommended that you already have a basic understanding of how to work with both pandas and Polars DataFrames, as well as Polars LazyFrames. To complete the examples in this tutorial, you'll…...
How to Drop Null Values in pandas – Real Python
4+ mon, 2+ week ago (1147+ words) Dealing with null values is essential for keeping datasets clean and avoiding the issues they can cause. Missing entries can lead to misinterpreted column data types, inaccurate conclusions, and errors in calculations. Simply put, nulls can cause havoc if they…...
Profiling Performance in Python – Real Python
5+ mon, 1+ hour ago (178+ words) Do you want to optimize the performance of your Python program to make it run faster or consume less memory? Before diving into any performance tuning, you should strongly consider using a technique called software profiling. It can help you…...
Use TorchAudio to Prepare Audio Data for Deep Learning – Real Python
6+ mon, 3+ week ago (1750+ words) Ever wondered how machine learning models process audio data? How do you handle different audio lengths, convert sound frequencies into learnable patterns, and make sure your model is robust? This tutorial will show you how to handle audio data using…...