-1

I have data in xlsx format looks below.

Column A Column B
Cell 1 ABCD
Cell 3 32,000,000

But when I read using pd.read_excel getting value of Cell 3 is 32000000. But I wants in same format 32,000,000. Please help to resolve this issue.

Expecting code which resolve my problem

  • You can format a number with commas to separate every thousand but that will effectively turn that into a string. – Musabbir Arrafi Aug 25 '23 at 07:21
  • but why pd remove coma when read from excel? – Tapan Dave Aug 25 '23 at 07:50
  • It (probably) _isn't_ removing commas. Excel is (probably) applying formatting to add them on display, but the underlying value is (probably) an integer. – ChrisGPT was on strike Aug 25 '23 at 19:13
  • It isn't removing it, they are not there to begin with. In Excel, a cell has data (for numbers, it is actually using a double precision floating point), and a *format*, which includes things like grouping symbols, etc. The format is used when *displaying* the data. `pd` is simply reading the data. – Mark Rotteveel Aug 26 '23 at 07:05

0 Answers0