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()