I have the current code using pandas:
file1_csv = 'fileX.csv'
data = pd.read_csv(file1_csv, header=None, usecols=[0,43])
print (data)
The result is this:
0 43
0 57669557 2020-02-15
1 57779240 2017-02-15
2 96951148 2018-07-24
What I need is to put this result into a new csv file and have something like this:
col1, col2
57669557,2020-02-15
57779240,2017-02-15
96951148,2018-07-24
My code is like this:
final = pd.DataFrame(data, columns=['col1','col2'])
final.to_csv('finalFile.csv', index=False)
But the output is wrong and generates the next:
col1,col2
,
,
,