yash-gupta-01 commited on
Commit
2eb8d69
Β·
1 Parent(s): 237684f

data page added

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