hari3485 commited on
Commit
a651333
·
verified ·
1 Parent(s): 02c9205

Update pages/Data Collection.py

Browse files
Files changed (1) hide show
  1. pages/Data Collection.py +4 -13
pages/Data Collection.py CHANGED
@@ -61,12 +61,7 @@ def excel_details_page():
61
  def csv_details_page():
62
  import streamlit as st
63
 
64
- # Set the page title
65
- st.set_page_config(page_title="Semi-Structured Data Handling Guide", page_icon="📄")
66
-
67
  # App header
68
- st.title("Semi-Structured Data Handling Guide")
69
- st.subheader("Learn how to manage semi-structured data (like CSV files) efficiently in Python")
70
 
71
  # Create a button
72
  if st.button("Semi-Structured Data"):
@@ -115,7 +110,6 @@ print(df.head())
115
 
116
  # Code example for handling parse errors
117
  st.code("""
118
- import pandas as pd
119
 
120
  # Skip bad lines
121
  df = pd.read_csv("file.csv", on_bad_lines="skip")
@@ -135,7 +129,6 @@ df = pd.read_csv("file.csv", on_bad_lines="warn")
135
 
136
  # Code example for trying multiple encodings
137
  st.code("""
138
- import pandas as pd
139
  import encodings
140
 
141
  # Get all encodings
@@ -162,7 +155,6 @@ for encoding in encodings_list:
162
 
163
  # Code example for handling large files
164
  st.code("""
165
- import pandas as pd
166
 
167
  chunk_size = 100
168
  chunks = pd.read_csv("large_file.csv", chunksize=chunk_size)
@@ -180,14 +172,13 @@ for i, chunk in enumerate(chunks):
180
  </ul>
181
  """, unsafe_allow_html=True)
182
 
 
 
 
 
183
 
184
  # Main page function
185
  def main_page():
186
- st.title("Welcome to the Data Handling Guide")
187
-
188
- # Introduction to data
189
- st.write("Explore handling Structured and Semi-Structured Data using Python.")
190
-
191
  # Buttons for navigation
192
  if st.button("Go to Structured Data - Excel"):
193
  st.session_state['page'] = "excel_details"
 
61
  def csv_details_page():
62
  import streamlit as st
63
 
 
 
 
64
  # App header
 
 
65
 
66
  # Create a button
67
  if st.button("Semi-Structured Data"):
 
110
 
111
  # Code example for handling parse errors
112
  st.code("""
 
113
 
114
  # Skip bad lines
115
  df = pd.read_csv("file.csv", on_bad_lines="skip")
 
129
 
130
  # Code example for trying multiple encodings
131
  st.code("""
 
132
  import encodings
133
 
134
  # Get all encodings
 
155
 
156
  # Code example for handling large files
157
  st.code("""
 
158
 
159
  chunk_size = 100
160
  chunks = pd.read_csv("large_file.csv", chunksize=chunk_size)
 
172
  </ul>
173
  """, unsafe_allow_html=True)
174
 
175
+ # Button to go back to the main page
176
+ if st.button("Back to Home"):
177
+ st.session_state['page'] = "home"
178
+
179
 
180
  # Main page function
181
  def main_page():
 
 
 
 
 
182
  # Buttons for navigation
183
  if st.button("Go to Structured Data - Excel"):
184
  st.session_state['page'] = "excel_details"