I have a pandas dataframe, some rows are number, i want to convert them to thousand separator. Tried this thousands=','
but not working, tried other solutions but how can i convert whole dataframe into thousand separator before to_csv
Example what i want:
convert 31752000
to 31,752,000
Here is the code i'm trying:
url = 'https://finance.yahoo.com/quote/RDS-A/balance-sheet?p=RDS-A'
table = pandas.read_html(url, attrs={
'class': 'Lh(1.7) W(100%) M(0)'}, header=0)
df = pandas.DataFrame(table[0])
print(df)
#Then save to csv
#df.to_csv('ydata.csv', index=False, header=True)