Can someone please help me to format just numbers in a data frame to "int" and "comma"? I tried doing the same and got an error message mentioned below.
Error: int() argument must be string, a bytes-like object or a number, not 'DataFrame'
import pandas as pddata1 = {'Header':['L1','L2','L3'], 'Val1':[float(1000.2),float(2000.40),float(300.55)],'Val2':[float(4000.3),float(500.00),float(60000.55)]}
The expected output is mentioned below.
Header | Val1 | Val2 |
---|---|---|
L1 | 1,000 | 4,000 |
L2 | 2,000 | 500 |
L3 | 301 | 60,001 |