I imported tab delimited file to create a dataframe (df) which has the following label:
label
1
2
3
1
This is stored as pandas.core.series.Series and I want to convert it to string format so that I can get rid of the decimals when I write this out to a text file.
df.class_label=df.label.fillna('')
df.to_string(columns=['label'],index=False)
The variable type is still Series, and output (text file) also has the decimals:
1.0 2.0 3.0 1.0
How to get rid of these decimals?
pd.read_csv(file,sep='\t')