Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| from streamlit_lottie import st_lottie # For Lottie animations | |
| import requests | |
| # Function to load Lottie animations | |
| def load_lottie_url(url): | |
| response = requests.get(url) | |
| if response.status_code == 200: | |
| return response.json() | |
| return None | |
| # Custom CSS for enhanced styling | |
| st.markdown( | |
| """ | |
| <style> | |
| .stApp { | |
| background: linear-gradient(135deg, #1f1c2c, #928dab); | |
| color: #E0E0E0; | |
| } | |
| .stTitle { | |
| text-align: center; | |
| color: #76FF03; | |
| } | |
| .css-1d391kg p, .css-1v0mbdj p { | |
| color: #B0BEC5; | |
| } | |
| .stButton > button:hover { | |
| background-color: #4CAF50; | |
| color: white; | |
| transform: scale(1.05); | |
| } | |
| </style> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| # App Title | |
| st.title("π Data Types Explorer") | |
| # Sidebar for navigation | |
| st.sidebar.subheader("π Explore Data Types") | |
| data_type = st.sidebar.selectbox( | |
| "Select a Type of Data:", | |
| ["Structured Data", "Unstructured Data", "Semi-Structured Data"] | |
| ) | |
| # Structured Data Section | |
| if data_type == "Structured Data": | |
| st.subheader("π Structured Data") | |
| st.write(""" | |
| **Definition**: Structured data is organized and stored in a predefined format like rows and columns, making it easily searchable and manageable. | |
| """) | |
| st.markdown(""" | |
| **Features**: | |
| - Fixed schema (e.g., tables with defined columns and data types). | |
| - Easy to process using query languages like SQL. | |
| - Relationships between data points are well-defined. | |
| """) | |
| st.markdown("**Examples**: Excel Files π, MySQL Databases πΎ") | |
| if st.button("Learn About Excel Files π"): | |
| st.subheader("Excel Files") | |
| st.write(""" | |
| Excel files store structured data in rows and columns, making them ideal for analysis, visualization, and calculations. | |
| """) | |
| st.code(""" | |
| import pandas as pd | |
| df = pd.read_excel('file.xlsx') | |
| df.to_csv('file.csv', index=False) | |
| """, language="python") | |
| if st.button("Learn About MySQL Databases π»"): | |
| st.subheader("MySQL Databases") | |
| st.write(""" | |
| MySQL is a relational database management system for storing structured data in tables. SQL is used to query and manipulate data. | |
| """) | |
| # Unstructured Data Section | |
| elif data_type == "Unstructured Data": | |
| st.subheader("ποΈ Unstructured Data") | |
| st.write(""" | |
| **Definition**: Unstructured data lacks any predefined structure or schema, making it the most difficult to organize and analyze. | |
| """) | |
| st.markdown("**Examples**: Images πΌοΈ, Videos π₯, Audio π, Text π") | |
| if st.button("Learn About Images π·"): | |
| st.subheader("Working with Images") | |
| st.write(""" | |
| Images are a form of unstructured data represented as grids of pixels. Common formats include JPG, PNG, and BMP. | |
| """) | |
| if st.button("Learn About Videos π₯"): | |
| st.subheader("Working with Videos") | |
| st.write(""" | |
| Videos are sequences of frames used in various applications like object detection and activity recognition. Common formats include MP4 and AVI. | |
| """) | |
| # Semi-Structured Data Section | |
| elif data_type == "Semi-Structured Data": | |
| st.subheader("π Semi-Structured Data") | |
| st.write(""" | |
| **Definition**: Semi-structured data is partially organized using tags or key-value pairs. It is more flexible than structured data. | |
| """) | |
| st.markdown("**Examples**: JSON Files π, XML Files π") | |
| if st.button("Learn About JSON Files π"): | |
| st.subheader("JSON Files") | |
| st.write(""" | |
| JSON stores data as key-value pairs and is commonly used in APIs and web development. | |
| """) | |
| if st.button("Learn About XML Files π"): | |
| st.subheader("XML Files") | |
| st.write(""" | |
| XML stores data in a tree structure with nested elements. It is used in configuration files and data exchange. | |
| """) | |
| # Footer | |
| st.write("This app provides a clear understanding of different data types. π") | |