To close the thread once and for all
spam.csv - view it in notepad++
e.g. in cell A3 you see
spam.csv - view it in notepad++
Output:2229708157109627
2204081406354342
892984837048418304
2229708157109620
2204081406354340
892984837048418000
# using csv import csv print('Print the file using csv module') with open('spam.csv') as f: rdr = csv.reader(f) for line in rdr: num, = line print(num) # here it prints it as str print(int(num)) # convert it to number # and using pandas print('\nPrint the file as pandas dataframe') import pandas as pd df = pd.read_csv('spam.csv',index_col=None, header=None) print(df)output
Output:Print the file using csv module
2229708157109627
2229708157109627
2204081406354342
2204081406354342
892984837048418304
892984837048418304
2229708157109620
2229708157109620
2204081406354340
2204081406354340
892984837048418000
892984837048418000
Print the file as pandas dataframe
0
0 2229708157109627
1 2204081406354342
2 892984837048418304
3 2229708157109620
4 2204081406354340
5 892984837048418000
and here is what you will see in Excel when open the same filee.g. in cell A3 you see
892984837048418000
but in fact in the file the value is 892984837048418304
Attached Files
spam.csv (Size: 112 bytes / Downloads: 122)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs