Similar to this post: Conversion text to number in python
I am having issues trying to convert a csv file to xlsx while maintaining cell format as numbers.
For the most part, my code works. It converts SOME text cells back to numbers, but any numbers with commas (like any number >= 1,000) remain as cells formatted as text.
Attached is my code and the result of the completed task
import pandas as pd
# Rename files
file1 = pd.read_csv(path0 + files[0])
Nfile1 = pd.ExcelWriter(path0 + 'Z Out Report.xlsx', engine = 'xlsxwriter', options = {'strings_to_numbers': True})
file1.to_excel(Nfile1, index = False)
Nfile1.save()
xlsx file after conversion from csv
As you can see, some numbers are still stored as text with the green arrow error.
I am trying to use this new xlsx file to read and write with, but I need those cells as numbers and not text.
Thanks for any help the community can provide!
Edit 1: Adding the csv file Csv file