I'm programming a little development, but I have problems writing to a CSV I don't want panda to write the name of the fields, but I couldn't remove this option, I read the documentation and added the argument "index_label=False" and "index=False " when exporting the file as follows:
import pandas as pd
a=[1,2,3,4,5]
b=[6,7,8,9,10]
expHISTORIA=pd.DataFrame([a,b]).transpose() #crear DataFrame
expHISTORIA.to_csv('Historias.csv',index=False,index_label=False, mode='a',sep=';') #crear el CSV
The problem is that the generated file contains fields, I want it not to print them, it only generates the file with the data.
What it prints is the following:
0 1
1 6
2 7
3 8
4 9
5 10
But the first two numbers are (0, 1) are fields that are created automatically and I don't want them to be there. Ideally it would print this:
1 6
2 7
3 8
4 9
5 10
Try with this:
header is a boolean parameter in which you define whether or not you want to write the headers of the dataframe.