My goal is to create a dataframe using Python.display that contains formatted values such that every value has a comma separator for every thousands. Like for example, I am trying to format all the values in the dataframe from these:
I have been looking at here and here, but I still can't make the formatting work. Does anyone have the solution to this?
Here's the code so far:
import pandas as pd
from IPython.display import HTML
styles = [
hover(),
dict(selector = "th",
props = [("font-size", "110%"),
("text-align", "left"),
("background-color", "#cacaca")
]
)
]
column_01 = [2000000000, 21000000, 3000]
df = pd.DataFrame(column_01)
html = (df.style.set_table_styles(styles))
'{0:,}'.format(100000000)
html