Tagged articles
loc
10 articles · Page 1 of 1
The article explains why deeply nested np.where calls hurt readability, speed, and maintainability, and demonstrates how using pandas assign() with boolean masks and loc can replace them, delivering 2‑4× faster execution on large DataFrames while keeping the logic clear and extensible.
NumPyPandasassign
0 likes · 14 min read

This article explains how using pandas loc and iloc inside Python loops can be extremely slow, demonstrates the performance difference with concrete timing examples, and shows that replacing them with the scalar accessors at and iat can accelerate the operation by up to sixty times.
A*PandasPython
0 likes · 5 min read

This article explains the differences between pandas loc/iloc and at/iat, demonstrates why using loc/iloc inside loops can be extremely slow, and shows how replacing them with at/iat can speed up DataFrame updates by up to 60 times.
A*DataFramesPandas
0 likes · 6 min read

This article provides a comprehensive guide to Pandas indexing in Python, covering basic loc and iloc selection, Boolean indexing, setting and resetting indices, multi‑level indexing, index alignment, sorting, dropping, and advanced methods such as at, iat, and query, with complete code examples.
Pandasboolean indexingdata indexing
0 likes · 9 min read

This article explains why Pandas' str.extract returns a DataFrame by default, when you must use .loc and an index to assign extracted values to a column, and clarifies the differences between Series and DataFrame assignments in various scenarios.
data-processinglocstr.extract
0 likes · 9 min read

This article explains how pandas loc and iloc work, demonstrates their slow performance when used inside loops, and shows that using the at and iat accessors provides a dramatically faster alternative for scalar assignments in DataFrames.
A*PandasPython
0 likes · 5 min read

This article explains why pandas loc/iloc operations inside Python loops are extremely slow, demonstrates the performance difference with concrete examples, and shows that using the scalar‑access methods at and iat can speed up the same task by dozens of times.
A*PandasPython
0 likes · 5 min read

This tutorial walks through installing Pandas, importing CSV and Excel files, building DataFrames from dictionaries, describing data, indexing with loc/iloc, and applying custom functions to transform columns, providing clear code examples and visual outputs.
Pandasapplydata import
0 likes · 6 min read

This article presents eight practical pandas data‑selection techniques—including boolean indexing, loc/iloc, isin, str.contains, where/mask, query, filter, and any/all—illustrated with code examples and visual outputs to help Python users efficiently extract and analyze data.
Pandasdata analysisdata selection
0 likes · 9 min read

This article demonstrates how to retrieve specific values from a pandas DataFrame with a MultiIndex using both straightforward reset‑index methods and native multi‑level indexing techniques such as chained .loc calls, tuple indexing, and level swapping.
Multi-IndexPandasPython
0 likes · 5 min read
