Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +74 -57
pages/Data Collection.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
|
|
|
|
| 4 |
st.set_page_config(
|
| 5 |
page_title="HomePage",
|
| 6 |
page_icon="π",
|
| 7 |
layout="wide"
|
| 8 |
)
|
|
|
|
| 9 |
# Global CSS for consistent styling across all pages
|
| 10 |
st.markdown("""
|
| 11 |
<style>
|
|
@@ -25,8 +27,7 @@ st.markdown("""
|
|
| 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");
|
|
@@ -35,94 +36,110 @@ st.markdown(
|
|
| 35 |
background-attachment: fixed;
|
| 36 |
}
|
| 37 |
</style>
|
| 38 |
-
|
| 39 |
-
unsafe_allow_html=True
|
| 40 |
-
)
|
| 41 |
|
|
|
|
| 42 |
st.markdown("""
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
|
|
|
| 46 |
|
|
|
|
| 47 |
st.write("""
|
| 48 |
**Data** is the measurements that are collected as a source of Information.
|
| 49 |
-
It refers raw facts, figures, and observations that can be collected, stored, and processed.
|
| 50 |
-
|
|
|
|
| 51 |
|
|
|
|
| 52 |
st.markdown("""
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
| 55 |
|
|
|
|
| 56 |
data_type = st.radio(
|
| 57 |
"Select the type of Data:",
|
| 58 |
-
("Structured Data", "Unstructured Data", "Semi-Structured Data")
|
|
|
|
| 59 |
|
|
|
|
| 60 |
if data_type == "Structured Data":
|
| 61 |
st.markdown("""
|
| 62 |
<div style="text-align: left; margin-top: 20px;">
|
| 63 |
-
<h3 style="color: #e25822;">What is Structured Data?</h3
|
| 64 |
-
|
|
|
|
|
|
|
| 65 |
st.markdown("""
|
| 66 |
<div style="text-align: left; margin-top: 20px;">
|
| 67 |
-
<h4 style="color: #5b2c6f;">Definition:</h4
|
|
|
|
|
|
|
| 68 |
st.write("""
|
| 69 |
Structured data refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
| 70 |
-
|
| 71 |
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
| 72 |
|
| 73 |
This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
|
| 74 |
""")
|
| 75 |
-
|
| 76 |
st.markdown("""
|
| 77 |
<div style="text-align: left; margin-top: 20px;">
|
| 78 |
-
<h4 style="color: #5b2c6f;">Characteristics:</h4
|
|
|
|
|
|
|
| 79 |
st.write("""
|
| 80 |
- Follows a fixed schema.
|
| 81 |
- Can be easily searched using query languages like SQL.
|
| 82 |
- Suitable for quantitative analysis.
|
| 83 |
""")
|
| 84 |
-
|
| 85 |
st.markdown("""
|
| 86 |
<div style="text-align: left; margin-top: 20px;">
|
| 87 |
-
<h4 style="color: #5b2c6f;">Example:</h4
|
|
|
|
|
|
|
| 88 |
st.write("""
|
| 89 |
-
A database of students with fields like
|
| 90 |
""")
|
| 91 |
-
|
| 92 |
-
# Add a table for the Student database example
|
| 93 |
-
st.table({
|
| 94 |
-
"Id" : [100,101,102,103]
|
| 95 |
-
"Name": ["Lakshmi Harika", "Varshitha","Hari Chandan","Shamitha"],
|
| 96 |
-
"Age": [22, 23,22,23],
|
| 97 |
-
"Gender": ["Female", "Female", "Male","Female"]
|
| 98 |
-
})
|
| 99 |
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
<style>
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
</style>
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
|
| 4 |
+
# Page configuration
|
| 5 |
st.set_page_config(
|
| 6 |
page_title="HomePage",
|
| 7 |
page_icon="π",
|
| 8 |
layout="wide"
|
| 9 |
)
|
| 10 |
+
|
| 11 |
# Global CSS for consistent styling across all pages
|
| 12 |
st.markdown("""
|
| 13 |
<style>
|
|
|
|
| 27 |
</style>
|
| 28 |
""", unsafe_allow_html=True)
|
| 29 |
|
| 30 |
+
st.markdown("""
|
|
|
|
| 31 |
<style>
|
| 32 |
.stApp {
|
| 33 |
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");
|
|
|
|
| 36 |
background-attachment: fixed;
|
| 37 |
}
|
| 38 |
</style>
|
| 39 |
+
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
# Page Title
|
| 42 |
st.markdown("""
|
| 43 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 44 |
+
<h2 style="color: #BB3385;">What is Data?πβ¨</h2>
|
| 45 |
+
</div>
|
| 46 |
+
""", unsafe_allow_html=True)
|
| 47 |
|
| 48 |
+
# Introduction Text
|
| 49 |
st.write("""
|
| 50 |
**Data** is the measurements that are collected as a source of Information.
|
| 51 |
+
It refers to raw facts, figures, and observations that can be collected, stored, and processed.
|
| 52 |
+
It has no meaning on its own until it is organized or analyzed to derive useful information.
|
| 53 |
+
""")
|
| 54 |
|
| 55 |
+
# Types of Data Section
|
| 56 |
st.markdown("""
|
| 57 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 58 |
+
<h2 style="color: #2a52be;">Types of Data</h2>
|
| 59 |
+
</div>
|
| 60 |
+
""", unsafe_allow_html=True)
|
| 61 |
|
| 62 |
+
# Radio Button for Data Type Selection
|
| 63 |
data_type = st.radio(
|
| 64 |
"Select the type of Data:",
|
| 65 |
+
("Structured Data", "Unstructured Data", "Semi-Structured Data")
|
| 66 |
+
)
|
| 67 |
|
| 68 |
+
# Structured Data Section
|
| 69 |
if data_type == "Structured Data":
|
| 70 |
st.markdown("""
|
| 71 |
<div style="text-align: left; margin-top: 20px;">
|
| 72 |
+
<h3 style="color: #e25822;">What is Structured Data?</h3>
|
| 73 |
+
</div>
|
| 74 |
+
""", unsafe_allow_html=True)
|
| 75 |
+
|
| 76 |
st.markdown("""
|
| 77 |
<div style="text-align: left; margin-top: 20px;">
|
| 78 |
+
<h4 style="color: #5b2c6f;">Definition:</h4>
|
| 79 |
+
</div>
|
| 80 |
+
""", unsafe_allow_html=True)
|
| 81 |
st.write("""
|
| 82 |
Structured data refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
|
|
|
| 83 |
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
| 84 |
|
| 85 |
This type of data is often used in relational databases and spreadsheets, where relationships between data points are explicitly defined.
|
| 86 |
""")
|
| 87 |
+
|
| 88 |
st.markdown("""
|
| 89 |
<div style="text-align: left; margin-top: 20px;">
|
| 90 |
+
<h4 style="color: #5b2c6f;">Characteristics:</h4>
|
| 91 |
+
</div>
|
| 92 |
+
""", unsafe_allow_html=True)
|
| 93 |
st.write("""
|
| 94 |
- Follows a fixed schema.
|
| 95 |
- Can be easily searched using query languages like SQL.
|
| 96 |
- Suitable for quantitative analysis.
|
| 97 |
""")
|
| 98 |
+
|
| 99 |
st.markdown("""
|
| 100 |
<div style="text-align: left; margin-top: 20px;">
|
| 101 |
+
<h4 style="color: #5b2c6f;">Example:</h4>
|
| 102 |
+
</div>
|
| 103 |
+
""", unsafe_allow_html=True)
|
| 104 |
st.write("""
|
| 105 |
+
A database of students with fields like ID, name, age, and gender:
|
| 106 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
+
# Corrected table for the Student database example
|
| 109 |
+
student_data = {
|
| 110 |
+
"Id": [100, 101, 102, 103],
|
| 111 |
+
"Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
|
| 112 |
+
"Age": [22, 23, 22, 23],
|
| 113 |
+
"Gender": ["Female", "Female", "Male", "Female"]
|
| 114 |
+
}
|
| 115 |
+
df = pd.DataFrame(student_data)
|
| 116 |
+
st.table(df)
|
| 117 |
+
|
| 118 |
+
# Additional CSS for the Table (Optional, if needed)
|
| 119 |
+
st.markdown("""
|
| 120 |
<style>
|
| 121 |
+
table {
|
| 122 |
+
width: 100%;
|
| 123 |
+
border-collapse: collapse;
|
| 124 |
+
text-align: left;
|
| 125 |
+
}
|
| 126 |
+
th {
|
| 127 |
+
padding: 10px;
|
| 128 |
+
border: 1px solid #dddddd;
|
| 129 |
+
background-color: #ffc87c;
|
| 130 |
+
color: #000000;
|
| 131 |
+
text-align: center;
|
| 132 |
+
}
|
| 133 |
+
td:nth-child(1) {
|
| 134 |
+
font-weight: bold;
|
| 135 |
+
}
|
| 136 |
+
td {
|
| 137 |
+
padding: 10px;
|
| 138 |
+
border: 1px solid #dddddd;
|
| 139 |
+
vertical-align: top;
|
| 140 |
+
}
|
| 141 |
+
td:nth-child(2), td:nth-child(3) {
|
| 142 |
+
width: 40%;
|
| 143 |
+
}
|
| 144 |
</style>
|
| 145 |
+
""", unsafe_allow_html=True)
|
|
|
|
|
|