Spaces:
Sleeping
Sleeping
Update pages/Data Collection.py
Browse files- pages/Data Collection.py +68 -67
pages/Data Collection.py
CHANGED
|
@@ -66,76 +66,77 @@ data_type = st.radio(
|
|
| 66 |
("Structured Data", "Unstructured Data", "Semi-Structured Data")
|
| 67 |
)
|
| 68 |
|
| 69 |
-
#
|
| 70 |
-
# Ensure session state is initialized
|
| 71 |
if "explore_excel" not in st.session_state:
|
| 72 |
st.session_state.explore_excel = False
|
| 73 |
|
| 74 |
-
if
|
| 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 |
-
st.
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
st.
|
| 138 |
-
|
|
|
|
|
|
|
| 139 |
if st.session_state.explore_excel:
|
| 140 |
st.markdown("""
|
| 141 |
<div style="text-align: left; margin-top: 20px;">
|
|
|
|
| 66 |
("Structured Data", "Unstructured Data", "Semi-Structured Data")
|
| 67 |
)
|
| 68 |
|
| 69 |
+
# Ensure session state for Explore Excel is initialized
|
|
|
|
| 70 |
if "explore_excel" not in st.session_state:
|
| 71 |
st.session_state.explore_excel = False
|
| 72 |
|
| 73 |
+
if not st.session_state.explore_excel:
|
| 74 |
+
if data_type == "Structured Data":
|
| 75 |
+
st.markdown("""
|
| 76 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 77 |
+
<h3 style="color: #e25822;">What is Structured Data?</h3>
|
| 78 |
+
</div>
|
| 79 |
+
""", unsafe_allow_html=True)
|
| 80 |
+
|
| 81 |
+
st.markdown("""
|
| 82 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 83 |
+
<h4 style="color: #5b2c6f;">Definition:</h4>
|
| 84 |
+
</div>
|
| 85 |
+
""", unsafe_allow_html=True)
|
| 86 |
+
st.write("""
|
| 87 |
+
**Structured data** refers to information that is organized and formatted in a predefined manner, making it easy to store, retrieve, and analyze.
|
| 88 |
+
It is typically stored in tabular formats like rows and columns, where each field contains a specific type of information.
|
| 89 |
+
""")
|
| 90 |
+
|
| 91 |
+
st.markdown("""
|
| 92 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 93 |
+
<h4 style="color: #5b2c6f;">Characteristics:</h4>
|
| 94 |
+
</div>
|
| 95 |
+
""", unsafe_allow_html=True)
|
| 96 |
+
st.write("""
|
| 97 |
+
- Follows a fixed schema.
|
| 98 |
+
- Can be easily searched using query languages like SQL.
|
| 99 |
+
- Suitable for quantitative analysis.
|
| 100 |
+
""")
|
| 101 |
+
|
| 102 |
+
st.markdown("""
|
| 103 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 104 |
+
<h4 style="color: #5b2c6f;">Examples:</h4>
|
| 105 |
+
</div>
|
| 106 |
+
""", unsafe_allow_html=True)
|
| 107 |
+
st.write("""
|
| 108 |
+
A database of students with fields like ID, name, age, and gender:
|
| 109 |
+
""")
|
| 110 |
+
|
| 111 |
+
student_data = {
|
| 112 |
+
"Id": [100, 101, 102, 103],
|
| 113 |
+
"Name": ["Lakshmi Harika", "Varshitha", "Hari Chandan", "Shamitha"],
|
| 114 |
+
"Age": [22, 23, 22, 23],
|
| 115 |
+
"Gender": ["Female", "Female", "Male", "Female"]
|
| 116 |
+
}
|
| 117 |
+
df = pd.DataFrame(student_data)
|
| 118 |
+
st.markdown(df.style.set_table_styles(
|
| 119 |
+
[{'selector': 'thead th', 'props': 'font-weight: bold;'}]
|
| 120 |
+
).hide(axis="index").to_html(), unsafe_allow_html=True)
|
| 121 |
+
|
| 122 |
+
st.markdown("""
|
| 123 |
+
<div style="text-align: left; margin-top: 20px;">
|
| 124 |
+
<h4 style="color: #5b2c6f;">Data Formats in Structured Data:</h4>
|
| 125 |
+
</div>
|
| 126 |
+
""", unsafe_allow_html=True)
|
| 127 |
+
|
| 128 |
+
st.write("Click to explore Structured Data Formats:")
|
| 129 |
+
if st.button("Structured Data Formats"):
|
| 130 |
+
st.write("Select a format to explore:")
|
| 131 |
+
|
| 132 |
+
# Sub-buttons for specific formats
|
| 133 |
+
col1, = st.columns(1)
|
| 134 |
+
|
| 135 |
+
with col1:
|
| 136 |
+
if st.button("Explore Excel"):
|
| 137 |
+
st.session_state.explore_excel = True
|
| 138 |
+
|
| 139 |
+
# Excel Content
|
| 140 |
if st.session_state.explore_excel:
|
| 141 |
st.markdown("""
|
| 142 |
<div style="text-align: left; margin-top: 20px;">
|