Update pages/LIFE_CYCLE_OF_MACHINE_LEARNING.py
Browse files
pages/LIFE_CYCLE_OF_MACHINE_LEARNING.py
CHANGED
@@ -180,6 +180,7 @@ except UnicodeDecodeError:
|
|
180 |
|
181 |
|
182 |
# ----------------- JSON Data Page -----------------
|
|
|
183 |
def json_page():
|
184 |
st.title(":green[JSON Data Format]")
|
185 |
|
@@ -191,7 +192,6 @@ def json_page():
|
|
191 |
st.write("### Reading JSON Files")
|
192 |
st.code("""
|
193 |
import json
|
194 |
-
|
195 |
# Read a JSON file
|
196 |
with open('data.json', 'r') as file:
|
197 |
data = json.load(file)
|
@@ -201,14 +201,12 @@ with open('data.json', 'r') as file:
|
|
201 |
st.write("### Writing JSON Files")
|
202 |
st.code("""
|
203 |
import json
|
204 |
-
|
205 |
# Write data to JSON file
|
206 |
data = {
|
207 |
"name": "Alice",
|
208 |
"age": 25,
|
209 |
"skills": ["Python", "Machine Learning"]
|
210 |
}
|
211 |
-
|
212 |
with open('data.json', 'w') as file:
|
213 |
json.dump(data, file, indent=4)
|
214 |
""", language='python')
|
@@ -220,11 +218,13 @@ with open('data.json', 'w') as file:
|
|
220 |
- JSON supports both strings and numbers, and other types like arrays and booleans, making it versatile for various data types.
|
221 |
""")
|
222 |
|
223 |
-
|
224 |
|
225 |
if st.button("Back to Structured Data"):
|
226 |
st.session_state.page = "structured_data"
|
227 |
|
|
|
|
|
228 |
# ----------------- Unstructured Data Page -----------------
|
229 |
def unstructured_data_page():
|
230 |
st.title(":blue[Unstructured Data]")
|
|
|
180 |
|
181 |
|
182 |
# ----------------- JSON Data Page -----------------
|
183 |
+
|
184 |
def json_page():
|
185 |
st.title(":green[JSON Data Format]")
|
186 |
|
|
|
192 |
st.write("### Reading JSON Files")
|
193 |
st.code("""
|
194 |
import json
|
|
|
195 |
# Read a JSON file
|
196 |
with open('data.json', 'r') as file:
|
197 |
data = json.load(file)
|
|
|
201 |
st.write("### Writing JSON Files")
|
202 |
st.code("""
|
203 |
import json
|
|
|
204 |
# Write data to JSON file
|
205 |
data = {
|
206 |
"name": "Alice",
|
207 |
"age": 25,
|
208 |
"skills": ["Python", "Machine Learning"]
|
209 |
}
|
|
|
210 |
with open('data.json', 'w') as file:
|
211 |
json.dump(data, file, indent=4)
|
212 |
""", language='python')
|
|
|
218 |
- JSON supports both strings and numbers, and other types like arrays and booleans, making it versatile for various data types.
|
219 |
""")
|
220 |
|
221 |
+
st.markdown('[Jupyter Notebook](https://colab.research.google.com/drive/1ZTKWTknL-4IQ9QbAfcyKzIP-_lNxmz2P?usp=sharing)')
|
222 |
|
223 |
if st.button("Back to Structured Data"):
|
224 |
st.session_state.page = "structured_data"
|
225 |
|
226 |
+
|
227 |
+
|
228 |
# ----------------- Unstructured Data Page -----------------
|
229 |
def unstructured_data_page():
|
230 |
st.title(":blue[Unstructured Data]")
|