Skip to content

Instantly share code, notes, and snippets.

@redavis22
Created May 6, 2023 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redavis22/4066e29c5a80b505af92d230da9cb94e to your computer and use it in GitHub Desktop.
Save redavis22/4066e29c5a80b505af92d230da9cb94e to your computer and use it in GitHub Desktop.
import pandas as pd
import streamlit as st
from faker import Faker
import random
# Set up the Faker object
fake = Faker()
# Create a list of items with emojis
items = ['๐Ÿ’ง Bottled Water', '๐Ÿฅซ Canned Food', '๐Ÿ”ฆ Flashlights', '๐Ÿ”‹ Batteries', '๐Ÿฉน First Aid Kit',
'๐Ÿ”ช Utility Knife', '๐Ÿ“ป Portable Radio', '๐Ÿ› ๏ธ Tool Kit', '๐Ÿงญ Compass', '๐Ÿงฏ Fire Extinguisher',
'๐Ÿ‘– Clothing', '๐Ÿ›๏ธ Sleeping Bag', '๐Ÿšฐ Water Purifier', '๐Ÿงผ Soap', '๐Ÿšฝ Toilet Paper',
'๐Ÿงน Broom', '๐Ÿšช Door Lock', '๐Ÿ”‘ Keys', '๐Ÿ”จ Hammer', '๐Ÿ”ฉ Nails',
'๐Ÿงฐ Power Drill', '๐Ÿงน Dustpan', '๐Ÿšง Road Cones', '๐Ÿšซ Danger Tape', '๐Ÿš‘ First Aid Kit',
'๐Ÿงฏ Fire Blanket', '๐Ÿ—บ๏ธ Maps', '๐Ÿ”ฎ Flashlight', '๐Ÿ“ฑ Solar Charger', '๐Ÿ”† Batteries',
'๐Ÿ”Œ Generator', '๐Ÿ” Binoculars', '๐ŸŒฌ๏ธ Fan', '๐ŸŽ’ Backpack', '๐Ÿงน Sweeper',
'๐Ÿงบ Laundry Bag', '๐Ÿฅพ Hiking Boots', '๐Ÿ‘• T-Shirts', '๐Ÿ‘– Jeans', '๐Ÿ‘Ÿ Sneakers',
'๐Ÿงข Hat', '๐Ÿ•ถ๏ธ Sunglasses', '๐Ÿงค Gloves', '๐Ÿงฃ Scarf', '๐Ÿ‘ฉโ€๐Ÿฆฑ Hair Brush']
# Create an empty dictionary to store the data
data = {'Item': items}
# Estimate the number of purchases for each item
estimates = [random.randint(50, 500) for _ in range(len(items))]
# Add estimated number of purchases for New Orleans
data['New Orleans Hurricane'] = estimates
# Create a DataFrame from the data dictionary
df = pd.DataFrame(data)
df.set_index('Item', inplace=True)
# Create a Streamlit chart
st.line_chart(df)
# Create a Streamlit chart
st.bar_chart(df)
# Calculate the cumulative sum of the item counts for New Orleans
cumulative_data = df.cumsum()
# Create an area chart of the cumulative data
st.area_chart(cumulative_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment