Glossary

DataFrame

A two-dimensional, table-like data structure with named, typed columns, used to manipulate data in code.

A DataFrame is a table-like data structure, rows and named, typed columns, used to hold and manipulate data programmatically, most associated with pandas in Python, R's built-in data.frame, and Apache Spark's DataFrame API. It gives code a structure similar to a spreadsheet or a SQL result set, but manipulated through a programming language rather than a query language alone.

A pandas DataFrame is typically held entirely in the memory of a single machine, which makes it fast and simple for datasets that fit in RAM but unusable beyond that scale. A Spark DataFrame looks and behaves similarly from the code's perspective, filtering, grouping, joining, but is actually a logical plan over data partitioned across a cluster of machines, only materialized and computed when an action, like writing output, is triggered. This difference, in-memory single-machine versus distributed and lazily evaluated, is invisible in the syntax but critical to how each performs at scale.

DataFrames matter because they let analysts and engineers express transformations, filter, aggregate, join, reshape, in code with much of the readability of SQL but with the flexibility of a general-purpose language for logic SQL handles awkwardly, like complex conditional branching or calling external functions row by row. A common pitfall is treating a distributed DataFrame like an in-memory one, calling an operation that forces the entire dataset to collect onto a single machine and running out of memory as a result.

Last reviewed September 22, 2026

In the index now

Related terms

Related guides