Reading CSV files

pd.read_csv() loads a CSV file into a DataFrame. Its parameters control the separator (sep), the encoding (encoding), the types (dtype), the dates (parse_dates), the columns to read (usecols) and the missing values (na_values). The right settings avoid type and reading errors.

Example

df = pd.read_csv('ventes.csv', sep=';', parse_dates=['date'])

Related concepts

The whole glossary