chatGPTPacMan / app.py
hhalim's picture
Update app.py
ca9af8e
raw
history blame
494 Bytes
import streamlit as st
import pandas as pd
import plotly.express as px
st.title('Random Population Dataset and Treemap')
# Generate random population dataset
data = pd.DataFrame({
'Country': ['USA', 'China', 'India', 'Japan', 'Germany'],
'Population': [331002651, 1403500365, 1377233523, 126476461, 82927922]
})
# Render table
st.table(data)
# Render plotly treemap
fig = px.treemap(data, path=['Country'], values='Population', title='Global Population')
st.plotly_chart(fig)