About 857,000 results
Open links in new tab
  1. Import CSV file as a Pandas DataFrame - Stack Overflow

    To read a CSV file as a pandas DataFrame, you'll need to use pd.read_csv, which has sep=',' as the default. But this isn't where the story ends; data exists in many different formats and is …

  2. python - Read CSV or Excel - Stack Overflow

    I'm allowing users to upload a CSV or Excel file. I'm using pandas to read the file and create a dataframe. Since I can't predict which filetype the user will upload, I wrapped pd.read_csv() …

  3. How do I read a large csv file with pandas? - Stack Overflow

    Apr 26, 2017 · If so, you can sometimes see massive memory savings by reading in columns as categories and selecting required columns via pd.read_csv usecols parameter. Does your …

  4. python - Pandas read in table without headers - Stack Overflow

    Mar 26, 2015 · Using pandas, how do I read in only a subset of the columns (say 4th and 7th columns) of a .csv file with no headers? I cannot seem to be able to do so using usecols.

  5. How to load a tsv file into a Pandas DataFrame? - Stack Overflow

    read_csv defaults to comma as the separator, so read_table is more convenient for TSV.

  6. UnicodeDecodeError when reading CSV file in Pandas

    import pandas as pd df = pd.read_csv('file_name.csv', engine='python') Alternate Solution: Sublime Text: Open the csv file in Sublime text editor or VS Code. Save the file in utf-8 format. …

  7. python - Pandas read_csv from url - Stack Overflow

    Sep 4, 2015 · For older pandas versions, or if you need authentication, or for any other HTTP-fault-tolerant reason: Use pandas.read_csv with a file-like object as the first argument. If you …

  8. python - How to read UTF-8 files with Pandas? - Stack Overflow

    Apr 7, 2016 · # file 1459966468_324.csv #1459966468_324.csv: UTF-8 Unicode English text df = pd.read_csv('1459966468_324.csv', dtype={'text': unicode}) df.dtypes text object Airline object …

  9. pandas read_csv and keep only certain rows (python)

    Sep 6, 2016 · pd.read_csv(path).loc[index_to_keep] Note: This is a slower approach, as here the entire file will be first loaded in the memory and then only seleted rows will be selected.

  10. Handling bad lines when reading csv files with pd.read_csv ()

    Feb 12, 2025 · The csv is structured with comma as a delimiter and quotation marks enclosing each field. I want to use pd.read_csv () to parse the data without skipping the faulty lines with …