File size: 494 Bytes
487aeac
ca9af8e
 
 
487aeac
ca9af8e
487aeac
ca9af8e
 
 
 
 
487aeac
ca9af8e
 
487aeac
ca9af8e
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

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)