Performing database-style operations on DataFrames
DataFrame
objects are analogous to tables in a database: each has a name we refer to it by, is composed of rows, and contains columns of specific data types. Consequently, pandas
allows us to carry out database-style operations on them. Traditionally, databases support a minimum of four operations, called CRUD: Create, Read, Update, and Delete.
A database query language—most commonly SQL (pronounced sequel or S-Q-L), which stands for Structured Query Language—is used to ask the database to perform these operations. Knowledge of SQL is not required for this book; however, we will look at the SQL equivalent for the pandas
operations that will be discussed in this section since it may aid the understanding of those familiar with SQL. Many data professionals have some familiarity with basic SQL, so consult the Further reading section for resources that provide a more formal introduction.
For this section, we will be...