import pandas as pd
= "https://raw.githubusercontent.com/fahadsultan/csc272/main/data/elections.csv"
url
= pd.read_csv(url) elections
Selection, Filtering and Dropping
In this section, we will learn how to extract and remove a subset of rows and columns in pandas. The two primary operations of data extraction are:
- Selection: Extracting subset of columns.
- Filtering: Extracting subset of rows.
Let’s start by loading the dataset.