Created
May 6, 2023 01:54
-
-
Save redavis22/4066e29c5a80b505af92d230da9cb94e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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