LakshmiHarika commited on
Commit
67c5513
·
verified ·
1 Parent(s): 8d8a98a

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +72 -130
pages/Data Collection.py CHANGED
@@ -6,39 +6,26 @@ st.set_page_config(
6
  page_icon="🚀",
7
  layout="wide"
8
  )
9
- # Global CSS for consistent styling across all pages
 
10
  st.markdown("""
11
  <style>
12
  body, .stApp {
13
- color: #4F4F4F; /* Replace with your desired font color */
14
- background-color: #FFFFFF; /* Optional: Set a fixed background color */
15
  }
16
  h1, h2, h3, h4, h5, h6 {
17
- color: #BB3385; /* Replace with your heading color */
18
  }
19
  p {
20
- color: #4F4F4F; /* Replace with your paragraph text color */
21
  }
22
  ul li {
23
- color: #4F4F4F; /* List item color */
24
  }
25
  </style>
26
  """, unsafe_allow_html=True)
27
 
28
- st.markdown(
29
- """
30
- <style>
31
- .stApp {
32
- background-image: url("https://huggingface.co/spaces/LakshmiHarika/MachineLearning/resolve/main/DALL%C2%B7E%202024-12-03%2023.34.47%20-%20A%20simple%20and%20elegant%20background%20image%20for%20an%20AI-themed%20web%20application.%20The%20background%20should%20feature%20a%20soft%20gradient%20transitioning%20from%20white%20to%20ligh.webp");
33
- background-size: cover;
34
- background-repeat: no-repeat;
35
- background-attachment: fixed;
36
- }
37
- </style>
38
- """,
39
- unsafe_allow_html=True
40
- )
41
-
42
  # Page Title
43
  st.markdown("""
44
  <div style="text-align: left; margin-top: 20px;">
@@ -48,8 +35,7 @@ st.markdown("""
48
 
49
  # Introduction Text
50
  st.write("""
51
- **Data** is the measurements that are collected as a source of Information.
52
- It refers to raw facts, figures, and observations that can be collected, stored, and processed.
53
  It has no meaning on its own until it is organized or analyzed to derive useful information.
54
  """)
55
 
@@ -74,39 +60,26 @@ if data_type == "Structured Data":
74
  </div>
75
  """, unsafe_allow_html=True)
76
 
77
- st.markdown("""
78
- <div style="text-align: left; margin-top: 20px;">
79
- <h4 style="color: #5b2c6f;">Definition:</h4>
80
- </div>
81
- """, unsafe_allow_html=True)
82
  st.write("""
83
- Structured data refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
84
  It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
85
 
86
  This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
87
  """)
88
 
89
- st.markdown("""
90
- <div style="text-align: left; margin-top: 20px;">
91
- <h4 style="color: #5b2c6f;">Characteristics:</h4>
92
- </div>
93
- """, unsafe_allow_html=True)
94
  st.write("""
 
95
  - Follows a fixed schema.
96
  - Can be easily searched using query languages like SQL.
97
  - Suitable for quantitative analysis.
98
  """)
99
 
100
- st.markdown("""
101
- <div style="text-align: left; margin-top: 20px;">
102
- <h4 style="color: #5b2c6f;">Example:</h4>
103
- </div>
104
- """, unsafe_allow_html=True)
105
  st.write("""
 
106
  A database of students with fields like ID, name, age, and gender:
107
  """)
108
 
109
- # Corrected table for the Student database example
110
  student_data = {
111
  "Id": [100, 101, 102, 103],
112
  "Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
@@ -114,107 +87,76 @@ if data_type == "Structured Data":
114
  "Gender": ["Female", "Female", "Male", "Female"]
115
  }
116
  df = pd.DataFrame(student_data)
117
- st.markdown(df.style.set_table_styles(
118
- [{
119
- 'selector': 'thead th',
120
- 'props': 'font-weight: bold;'
121
- }]
122
- ).hide(axis="index").to_html(), unsafe_allow_html=True)
123
-
124
- # Transition to Data Formats in Structured Data
 
 
 
 
 
 
 
125
  st.markdown("""
126
  <div style="text-align: left; margin-top: 20px;">
127
- <h4 style="color: #5b2c6f;">Data Formats in Structured Data:</h4>
128
  </div>
129
  """, unsafe_allow_html=True)
130
-
131
  st.write("""
132
- Structured data can be stored and managed in various formats, each designed for specific use cases.
133
- Some common data formats include:
134
 
135
- - **Excel**: Widely used for tabular data, calculations, and data visualization.
136
- """)
137
-
138
- # Add a button to navigate to the Excel page
139
- if st.button("Explore Excel"):
140
- st.query_params["page"] = "Excel"
141
- st.rerun()
142
-
143
- # Unstructured Data Section
144
- elif data_type == "Unstructured Data":
145
- st.markdown("""
146
- <div style="text-align: left; margin-top: 20px;">
147
- <h3 style="color: #e25822;">What is Unstructured Data?</h3>
148
- </div>
149
- """, unsafe_allow_html=True)
150
-
151
- st.markdown("""
152
- <div style="text-align: left; margin-top: 20px;">
153
- <h4 style="color: #5b2c6f;">Definition:</h4>
154
- </div>
155
- """, unsafe_allow_html=True)
156
- st.write("""
157
- Unstructured data refers to information that does not follow a predefined format or structure.
158
- It is typically raw data that lacks a clear, organized schema, making it harder to store and analyze using traditional tools.
159
-
160
- Examples include multimedia files (images, videos, audio), emails, and social media posts.
161
- """)
162
-
163
- st.markdown("""
164
- <div style="text-align: left; margin-top: 20px;">
165
- <h4 style="color: #5b2c6f;">Characteristics:</h4>
166
- </div>
167
- """, unsafe_allow_html=True)
168
- st.write("""
169
- - Does not follow a specific schema or structure.
170
- - Cannot be stored in traditional tabular formats like rows and columns.
171
- - Requires advanced tools like machine learning or natural language processing (NLP) for analysis.
172
- """)
173
-
174
- st.markdown("""
175
- <div style="text-align: left; margin-top: 20px;">
176
- <h4 style="color: #5b2c6f;">Example:</h4>
177
- </div>
178
- """, unsafe_allow_html=True)
179
- st.write("""
180
- Examples of unstructured data include:
181
- - **Images**: Photos, screenshots, or scanned documents.
182
- - **Audio**: Podcasts, voice recordings, or music files.
183
- - **Videos**: Recorded lectures, surveillance footage, or YouTube videos.
184
- - **Text**: Emails, social media posts, and blog articles.
185
- """)
186
-
187
- # Transition to Formats in Unstructured Data
188
- st.markdown("""
189
- <div style="text-align: left; margin-top: 20px;">
190
- <h4 style="color: #5b2c6f;">Data Formats in Unstructured Data:</h4>
191
- </div>
192
- """, unsafe_allow_html=True)
193
-
194
- st.write("""
195
- Unstructured data can exist in various formats, often requiring specialized tools for processing. Common formats include:
196
-
197
- - **Images**: Formats like JPEG, PNG, BMP, and TIFF.
198
- - **Audio**: Formats like MP3, WAV, and FLAC.
199
- - **Videos**: Formats like MP4, AVI, and MKV.
200
- - **Text**: Formats like TXT, LOG, and DOCX.
201
- """)
202
-
203
- # Add a button to navigate to specific formats
204
- if st.button("Explore Unstructured Data"):
205
- # Display buttons for each format
206
- st.write("Select a format to explore:")
207
-
208
  if st.button("Images"):
209
- st.write("Images are a type of unstructured data often used in computer vision. Common formats: JPEG, PNG.")
210
-
 
211
  if st.button("Audio"):
212
  st.write("Audio files represent sound data. Common formats: MP3, WAV.")
213
-
 
214
  if st.button("Video"):
215
  st.write("Video files combine visual and audio data. Common formats: MP4, AVI.")
216
-
 
217
  if st.button("Text"):
218
  st.write("Text data includes raw documents like emails or logs. Common formats: TXT, DOCX.")
219
-
220
-
 
6
  page_icon="🚀",
7
  layout="wide"
8
  )
9
+
10
+ # Global CSS for consistent styling
11
  st.markdown("""
12
  <style>
13
  body, .stApp {
14
+ color: #4F4F4F;
15
+ background-color: #FFFFFF;
16
  }
17
  h1, h2, h3, h4, h5, h6 {
18
+ color: #BB3385;
19
  }
20
  p {
21
+ color: #4F4F4F;
22
  }
23
  ul li {
24
+ color: #4F4F4F;
25
  }
26
  </style>
27
  """, unsafe_allow_html=True)
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  # Page Title
30
  st.markdown("""
31
  <div style="text-align: left; margin-top: 20px;">
 
35
 
36
  # Introduction Text
37
  st.write("""
38
+ **Data** refers to raw facts, figures, and observations that can be collected, stored, and processed.
 
39
  It has no meaning on its own until it is organized or analyzed to derive useful information.
40
  """)
41
 
 
60
  </div>
61
  """, unsafe_allow_html=True)
62
 
 
 
 
 
 
63
  st.write("""
64
+ **Structured data** refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
65
  It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
66
 
67
  This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
68
  """)
69
 
 
 
 
 
 
70
  st.write("""
71
+ **Characteristics:**
72
  - Follows a fixed schema.
73
  - Can be easily searched using query languages like SQL.
74
  - Suitable for quantitative analysis.
75
  """)
76
 
 
 
 
 
 
77
  st.write("""
78
+ **Example:**
79
  A database of students with fields like ID, name, age, and gender:
80
  """)
81
 
82
+ # Display Structured Data Table
83
  student_data = {
84
  "Id": [100, 101, 102, 103],
85
  "Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
 
87
  "Gender": ["Female", "Female", "Male", "Female"]
88
  }
89
  df = pd.DataFrame(student_data)
90
+ st.dataframe(df)
91
+
92
+ # Data Formats in Structured Data
93
+ st.write("""
94
+ **Data Formats in Structured Data:**
95
+ - **Excel**: Widely used for tabular data, calculations, and data visualization.
96
+ """)
97
+
98
+ # Button to Explore Excel
99
+ if st.button("Explore Excel"):
100
+ st.write("Redirecting to Excel page...")
101
+ # Add functionality to redirect or display additional details here
102
+
103
+ # Unstructured Data Section
104
+ elif data_type == "Unstructured Data":
105
  st.markdown("""
106
  <div style="text-align: left; margin-top: 20px;">
107
+ <h3 style="color: #e25822;">What is Unstructured Data?</h3>
108
  </div>
109
  """, unsafe_allow_html=True)
110
+
111
  st.write("""
112
+ **Unstructured data** refers to information that does not follow a predefined format or structure.
113
+ It is typically raw data that lacks a clear, organized schema, making it harder to store and analyze using traditional tools.
114
 
115
+ Examples include multimedia files (images, videos, audio), emails, and social media posts.
116
+ """)
117
+
118
+ st.write("""
119
+ **Characteristics:**
120
+ - Does not follow a specific schema or structure.
121
+ - Cannot be stored in traditional tabular formats like rows and columns.
122
+ - Requires advanced tools like machine learning or natural language processing (NLP) for analysis.
123
+ """)
124
+
125
+ st.write("""
126
+ **Example:**
127
+ Examples of unstructured data include:
128
+ - **Images**: Photos, screenshots, or scanned documents.
129
+ - **Audio**: Podcasts, voice recordings, or music files.
130
+ - **Videos**: Recorded lectures, surveillance footage, or YouTube videos.
131
+ - **Text**: Emails, social media posts, and blog articles.
132
+ """)
133
+
134
+ # Data Formats in Unstructured Data
135
+ st.write("""
136
+ **Data Formats in Unstructured Data:**
137
+ - **Images**: Formats like JPEG, PNG, BMP, and TIFF.
138
+ - **Audio**: Formats like MP3, WAV, and FLAC.
139
+ - **Videos**: Formats like MP4, AVI, and MKV.
140
+ - **Text**: Formats like TXT, LOG, and DOCX.
141
+ """)
142
+
143
+ # Explore Formats
144
+ if st.button("Explore Unstructured Data"):
145
+ st.write("Select a format to explore:")
146
+ col1, col2, col3, col4 = st.columns(4)
147
+
148
+ with col1:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  if st.button("Images"):
150
+ st.write("Images are often used in computer vision tasks. Common formats: JPEG, PNG.")
151
+
152
+ with col2:
153
  if st.button("Audio"):
154
  st.write("Audio files represent sound data. Common formats: MP3, WAV.")
155
+
156
+ with col3:
157
  if st.button("Video"):
158
  st.write("Video files combine visual and audio data. Common formats: MP4, AVI.")
159
+
160
+ with col4:
161
  if st.button("Text"):
162
  st.write("Text data includes raw documents like emails or logs. Common formats: TXT, DOCX.")