bespectacled
bespectacled

Reputation: 2901

Why pandas read_csv returns only the first 1024 columns?

We're using pandas on jupyter notebook to load a csv file like:

 import pandas as pd
 dat=pd.read_csv("data.csv")

running the above line of code more than once returns only the first 1024 columns. We've tried options like:

pd.read_csv("data.csv", na_values ='na', engine='python', delimiter=',', header=0, quoting=csv.QUOTE) to no avail. 

Here's a snapshot of the data:

enter image description here

What is the right way to read a csv file as a pandas dataframe ?

Upvotes: 0

Views: 245

Answers (1)

MEdwin
MEdwin

Reputation: 2960

Check the csv file you are using. I have just tested read_csv for 1,804 columns and it does work.

see the mockup below:

import pandas as pd
dat=pd.read_csv("bigcolumns.csv")
dat

Results:

enter image description here

Upvotes: 1

Related Questions