[Python] Importing a CSV file in pandas into a pandas dataframe

Discussão em 'Python' iniciado por Stack, Julho 1, 2025.

  1. Stack

    Stack Membro Participativo

    I have a CSV file taken from a SQL dump that looks like the below (first few lines using head file.csv from terminal):

    ??AANAT,AANAT1576,4
    AANAT,AANAT1704,1
    AAP,AAP-D-12-00691,8
    AAP,AAP-D-12-00834,3


    When I use the pd.read_csv('file.csv') command I get an error "ValueError: No columns to parse from file".

    Any ideas on how to import the CSV file into a table and avoid the error?

    ELABORATION OF QUESTION (following Ed's comment)

    I have tried header = None, skiprows=1 to avoid the ?? (which appear when using the head command from the terminal).

    Continue reading...

Compartilhe esta Página