...

/

Introducing Selection & Filters in Pandas

Introducing Selection & Filters in Pandas

Learn how to utilize techniques for selecting subsets of data and filtering DataFrames.

Introduction

The ability to select specific rows and columns to access and filter data based on specific conditions are two of the key features of Pandas.

Selection allows you to access specific rows or columns of the data by their index and/or location in the DataFrame. If a medical dataset is indexed by Patient Insurance Number, you can access the patient whose insurance is 123 by an index lookup. You can also access the first/last patient in the DataFrame (or in any specific location).

Filtering allows you to choose a subset of the data we would like to keep. In a travel dataset, you can filter by a ...