Python Pandas File I/O
The pandas module supports multiple helper commands to create a DataFrame from data files.
Contents
CSV
To import a CSV file:
import pandas as pd data = pd.read_csv("example.csv", index_col="UniqueID")
If the index_col argument is left off, the DataFrame will be indexed by sequential integers.
Columns can be filtered with the usecols argument.
data = pd.read_csv("example.csv", usecols=["First"])