│ pd.read_csv(., thousands='.', decimal=',') │ thousands and decimal │ Numeric data is in European format (eg., 1.234,56) │ │ pd.read_csv(., usecols=) │ usecols │ Read subset of columns │ │ pd.read_csv(., index_col=) │ index_col │ Specify which column to set as the index⁴ │ │ pd.read_csv(., header=False, names=) │ header and names │ Read CSV without headers³ │ │ pd.read_csv(., encoding='latin-1') │ encoding │ Fix UnicodeDecodeError while reading² │ │ pd.read_csv(., delim_whitespace=True) │ delim_whitespace │ Read CSV with tab/whitespace separator │ │ pd.read_csv(., sep=' ') │ sep/delimiter │ Read CSV with different separator¹ │ │ pandas Implementation │ Argument │ Description │ You will usually need all or some combination of the arguments below to read in your data. Here's a table listing common scenarios encountered with CSV files along with the appropriate argument you will need to use.
To read a CSV file as a pandas DataFrame, you'll need to use pd.read_csv.īut this isn't where the story ends data exists in many different formats and is stored in different ways so you will often need to pass additional parameters to read_csv to ensure your data is read in properly.