Zero_to_Hero_ML / pages /excel_Files.py
Sathwikchowdary's picture
Update pages/excel_Files.py
1baf5ed verified
import streamlit as st
import pandas as pd
import numpy as np
# Custom CSS for styling
custom_css = """
<style>
html, body, [data-testid="stAppViewContainer"] {
background-image: linear-gradient(
rgba(0, 0, 0, 0.6),
rgba(0, 0, 0, 0.6)
),
url("https://www.istockphoto.com/photo/tech-or-space-background-abstract-3d-illustration-gm1367865109-437999705?utm_source=pixabay&utm_medium=affiliate&utm_campaign=SRP_photo_sponsored&utm_content=https%3A%2F%2Fpixabay.com%2Fphotos%2Fsearch%2Fbackground%2520datascience%2F&utm_term=background+datascience.jpg");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
color: white; /* Ensures all text is readable */
}
h2, h3 {
color: #FFD700; /* Gold color for headings */
}
p {
color: #FFFFFF; /* White text for paragraphs */
}
</style>
"""
# Inject the CSS into the app
st.markdown(custom_css, unsafe_allow_html=True)
st.markdown("<h2 style='text-align: left; color: Black;'>📈What is Excel</h2>", unsafe_allow_html=True)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Excel is a popular tool for data management and analysis, commonly used to organize datasets that can then be used for machine learning tasks. For machine learning, Excel often serves as an initial data source before the data is preprocessed and fed into ML algorithms for tasks such as classification, regression, clustering, etc."
"</p>",
unsafe_allow_html=True
)
st.markdown("<h2 style='text-align: left; color: Black;'>📈How to read Excel files</h2>", unsafe_allow_html=True)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Excel files can be read in various programming languages like Python (pandas), Matlab, R, and Microsoft Excel application."
"</p>",
unsafe_allow_html=True
)
st.markdown("<h2 style='text-align: left; color: Black;'>📈Issues encountered when handling these files</h2>", unsafe_allow_html=True)
st.markdown("1. Corrupted Files")
st.markdown("2. Inconsistent Data Types")
st.markdown("3. Missing or Null Values")
st.markdown("4. Large File Size")
st.markdown("<h2 style='text-align: left; color: Black;'>📈How to overcome these errors/issues.</h2>", unsafe_allow_html=True)
st.markdown("<h3 style='text-align: left; color: Black;'>📈Corrupted Files</h3>", unsafe_allow_html=True)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Use Excel's built-in 'Open and Repair' feature to try to recover the file."
"</p>",
unsafe_allow_html=True
)
st.markdown("<h3 style='text-align: left; color: Black;'>📈Inconsistent Data </h3>", unsafe_allow_html=True)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Preprocess the data by explicitly converting columns to the correct data type using pandas (e.g., pd.to_numeric() for numeric data). Use Excel’s Data Validation feature to ensure consistent data entry."
"</p>",
unsafe_allow_html=True
)
st.markdown("<h3 style='text-align: left; color: Black;'>📈Null Values</h3>", unsafe_allow_html=True)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Many Excel files contain missing or blank cells, which can interfere with analysis or cause errors during processing."
"</p>",
unsafe_allow_html=True
)
st.markdown("<h3 style='text-align: left; color: Black;'>📈Large File Size</h3>", unsafe_allow_html=True)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Large Excel files with many rows and columns can cause performance issues, especially when reading them into memory with tools like Python."
"</p>",
unsafe_allow_html=True
)
# Add Jupyter Notebook link at the end
st.markdown(
"<h3 style='text-align: left; color: Black;'>📈Learn More in the Jupyter Notebook</h3>",
unsafe_allow_html=True
)
st.markdown(
"<p style='font-size: 16px; color: White; font-style: italic;'>"
"Click the link below to open the Jupyter Notebook for further exploration."
"</p>",
unsafe_allow_html=True
)
# Insert your Jupyter Notebook URL here
st.markdown(
"<a href='https://colab.research.google.com/drive/1ubmOssUfbrldtVODVsVHSyW7o8Nk7rP9?usp=sharing' target='_blank' style='font-size: 16px; color: white;'>Open Jupyter Notebook</a>",
unsafe_allow_html=True
)