Read a Subset of Columns from a CSV into a Pandas DataFrame
Python
Import and Export
To read only a subset of columns into a Pandas dataframe from a csv file, pass a list of columns to the "usecols" parameter when calling read_csv.
In the example below, only the columns order_number, product and sale_price are read into the dataframe.
1| import pandas as pd 2| 3| columns = ['order_number', 'product', 'sale_price'] 4| df = pd.read_csv('sales.csv', usecols=columns)
2
Creating a Pandas DataFrame from a Python Generator
Python
Import and Export
2
2
2
Reading CSV Files from Amazon S3 into Pandas Dataframes
Python
Import and Export
1
Sklearn Iris Dataset - Load The Iris Dataset & Split Into Features & Target
Python
Import and Export
1
Using Selectors in Beautiful Soup to Scrape Using Classes & IDs
Python
Import and Export
1
1
1
Find the Nth Tag On a WebPage with Beautiful Soup
Python
Import and Export
1