0

I searched and found this answer While I understand the answer, my question is: Are there any possible ways to write data from DF explicitly to CSV and without any possible conversion? Is there an option to do that?

Example, value ".227" is stored to CSV as "022699999999999998"

I have this simple code, after scraping some data with BS, I open it in DF and then write to CSV:

table = soup.find('table', id='awer')
df1 = pd.read_html(str(table))
df1[0]['seas'] = season
print(df1[0])
df1[0].to_csv('abc.csv', encoding='utf=8', index=False, header=None , mode='a')

To verify, before appending I have printed out DF and everything is fine. So there is some kind of a conversion ongoing while appending data to CSV.

Any ideas how to solve it?

Thanks

botafogo
  • 189
  • 7

1 Answers1

0

Do you mean something like df.astype('unicode')?

gosuto
  • 5,422
  • 6
  • 36
  • 57