the data could not be loaded completely because the maximum number of columns per sheet was exceeded

Viewed 5870

I am trying to redirect my python code into a csv file. The problem is that I need 3072 columns and that's exactly what my code creates.

But when I open the created csv file only 1024 columns are displayed (which is the limit number of columns I think) and I got the following error "the data could not be loaded completely because the maximum number of columns per sheet was exceeded"

    import csv
    orig_stdout = sys.stdout
    f = open('image_to_pixel.csv', 'w')
    some code ....
    sys.stdout = orig_stdout
    f.close()

I am using Libreoffice 5.1.6.2, any idea to solve this problem guys ? Thanks.

1 Answers

You can import your csv file using dataframes. It will load all the 3072 columns.

import pandas as pd
read = pd.read_csv('image_to_pixel.csv',header=None)
your code.....
Related