Spaces:
Build error
Build error
File size: 6,082 Bytes
2ae5419 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
import streamlit as st
def main():
st.set_page_config(page_title="Data Demystified", page_icon="π", layout="wide")
# Custom CSS for better engagement
st.markdown("""
<style>
.highlight-box {
padding: 1rem;
border-radius: 10px;
background: #f0f2f6;
margin: 1rem 0;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.fun-fact {
color: #2e7d32;
font-weight: 500;
}
.emoji-header {
font-size: 2.5rem !important;
margin-bottom: 1rem;
}
</style>
""", unsafe_allow_html=True)
pages = {
"π Introduction": intro_page,
"π Data Types Overview": types_page,
"ποΈ Structured Data": structured_page,
"π§© Semi-Structured Data": semi_structured_page,
"π¨ Unstructured Data": unstructured_page
}
with st.sidebar:
st.title("Navigation")
page = st.radio("Go to", list(pages.keys()))
pages[page]()
def intro_page():
st.markdown('<div class="emoji-header">π Welcome to Data Science Fundamentals</div>', unsafe_allow_html=True)
col1, col2 = st.columns([3, 2])
with col1:
st.write("""
### What is Data Science?
Data Science is the art of extracting meaningful insights from raw data -
like being a digital detective uncovering hidden patterns in the numbers!
**Did you know?** π€
<span class="fun-fact">Every day, we create 2.5 quintillion bytes of data -
that's equivalent to 250,000 Libraries of Congress!</span>
""", unsafe_allow_html=True)
st.markdown("""
### Why It Matters:
- Predict future trends π
- Solve complex problems π§©
- Power AI innovations π€
- Drive business decisions πΌ
""")
with col2:
st.image("https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/qpmLGi47ucDCWYEi8eZhE.png",
caption="Data is Everywhere!", width=300)
def types_page():
st.header("π¦ The Three Data Superheroes")
with st.expander("π Quick Comparison"):
st.table({
"Type": ["Structured", "Semi-Structured", "Unstructured"],
"Organization": ["Perfectly Organized", "Partially Organized", "Chaotic Creativity"],
"Examples": ["SQL Databases, Excel", "JSON, XML, CSV", "Images, Videos, Text"]
})
cols = st.columns(3)
data_types = [
("ποΈ Structured", "Neat rows & columns", "#e3f2fd"),
("π§© Semi-Structured", "Flexible tags & markers", "#f0f4c3"),
("π¨ Unstructured", "Creative free-form", "#ffcdd2")
]
for col, (icon, desc, color) in zip(cols, data_types):
with col:
st.markdown(f"""
<div style="background: {color}; padding: 1rem; border-radius: 10px;">
<h3>{icon} {desc.split()[0]}</h3>
<p>{' '.join(desc.split()[1:])}</p>
</div>
""", unsafe_allow_html=True)
def structured_page():
st.header("ποΈ Structured Data: The Organized Perfectionist")
with st.container():
st.markdown("""
### Characteristics:
- Strict schema π
- Tabular format π
- Easy to query π
**Did you know?** π€
<span class="fun-fact">The first computerized database appeared in 1963 -
it weighed more than a car! ππΎ</span>
""", unsafe_allow_html=True)
st.image("https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/dSbyOXaQ6N_Kg2TLxgEyt.png",
width=400, caption="Structured Data Example")
with st.expander("π‘ Real-World Examples"):
st.markdown("""
- Financial records π°
- Inventory systems π¦
- Student databases π
- Railway timetables π
""")
def semi_structured_page():
st.header("π§© Semi-Structured Data: The Flexible Friend")
with st.container():
st.markdown("""
### Why It's Special:
- Partial organization π
- Self-describing formats π
- Web-friendly π
**Did you know?** π€
<span class="fun-fact">JSON was created in 2001 -
the same year Wikipedia launched! ππ</span>
""", unsafe_allow_html=True)
cols = st.columns(2)
with cols[0]:
st.code("""
{
"name": "Data Hero",
"skills": ["JSON", "XML", "CSV"],
"mission": "Bring order to chaos!"
}
""", language="json")
with cols[1]:
st.markdown("""
### Common Formats:
- JSON (Web APIs) π
- XML (Document markup) π
- CSV (Spreadsheet data) π
- Email headers π§
""")
def unstructured_page():
st.header("π¨ Unstructured Data: The Creative Chaos")
with st.container():
st.markdown("""
### The Wild West of Data:
- No predefined format π¨
- Human-friendly formats π
- Requires AI processing π€
**Did you know?** π€
<span class="fun-fact">90% of all digital data is unstructured -
that's like having 1000 Netflix movies for every person on Earth! πΏπ</span>
""", unsafe_allow_html=True)
st.image("https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/xhaNBRanDaj8esumqo9hl.png",
width=400, caption="Unstructured Data in Action")
with st.expander("π Modern Applications"):
st.markdown("""
- Facial recognition systems π©π»
- Voice assistants π£οΈ
- Medical image analysis π₯
- Social media monitoring π±
""")
if __name__ == "__main__":
main() |