Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,31 +1,32 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import
|
| 3 |
-
|
| 4 |
|
| 5 |
# Custom CSS for background, fonts, and text styling
|
| 6 |
st.markdown("""
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
-
background-color: #
|
| 10 |
}
|
| 11 |
h1 {
|
| 12 |
color: #d63384;
|
| 13 |
-
font-family: '
|
| 14 |
font-weight: bold;
|
| 15 |
text-align: center;
|
|
|
|
| 16 |
}
|
| 17 |
h2 {
|
| 18 |
color: #1f77b4;
|
| 19 |
-
font-family: '
|
| 20 |
font-weight: bold;
|
| 21 |
}
|
| 22 |
h3 {
|
| 23 |
color: #6c757d;
|
| 24 |
-
font-family: '
|
| 25 |
}
|
| 26 |
.custom-subheader {
|
| 27 |
color: #2ca02c;
|
| 28 |
-
font-family: '
|
| 29 |
margin-bottom: 0;
|
| 30 |
}
|
| 31 |
p {
|
|
@@ -35,6 +36,7 @@ st.markdown("""
|
|
| 35 |
}
|
| 36 |
.icon-bullet {
|
| 37 |
list-style-type: none;
|
|
|
|
| 38 |
}
|
| 39 |
.icon-bullet li::before {
|
| 40 |
content: "✔️";
|
|
@@ -43,11 +45,15 @@ st.markdown("""
|
|
| 43 |
</style>
|
| 44 |
""", unsafe_allow_html=True)
|
| 45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
# Title Section
|
| 47 |
st.title(":red[**1 : INTRODUCTION TO STATISTICS**]")
|
| 48 |
st.markdown("""
|
| 49 |
In this field, we will be dealing with data using the programming language Python. The term **DATA ANALYSIS** itself indicates working with data. We will collect, clean, and analyze the data to gain insights. Let's first understand the term *data*.
|
| 50 |
-
""",unsafe_allow_html=True)
|
| 51 |
|
| 52 |
# Header Section
|
| 53 |
st.header("*What does the term data refer to?*")
|
|
@@ -65,7 +71,7 @@ st.markdown("""
|
|
| 65 |
</ul>
|
| 66 |
""", unsafe_allow_html=True)
|
| 67 |
|
| 68 |
-
# Data Classification Section
|
| 69 |
st.header("DATA is classified into 3 types.")
|
| 70 |
st.subheader("**Structured Data**")
|
| 71 |
st.markdown("""
|
|
@@ -77,6 +83,21 @@ st.markdown("""
|
|
| 77 |
""", unsafe_allow_html=True)
|
| 78 |
st.image('https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/dSbyOXaQ6N_Kg2TLxgEyt.png', width=400)
|
| 79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
st.subheader("**Unstructured Data**")
|
| 81 |
st.markdown("""
|
| 82 |
This type of data is not organized in a predefined manner. Examples include:
|
|
@@ -107,7 +128,7 @@ st.markdown("""
|
|
| 107 |
_Statistics is a branch of mathematics focused on collecting, analyzing, interpreting, and structuring data. It is classified into two types:_
|
| 108 |
""")
|
| 109 |
|
| 110 |
-
# Descriptive Statistics Section
|
| 111 |
st.subheader("2.1 Descriptive Statistics")
|
| 112 |
st.markdown("""
|
| 113 |
Descriptive Statistics describes the main features of data. It can be performed on sample data as well as population data. Key concepts include:
|
|
@@ -118,8 +139,13 @@ st.markdown("""
|
|
| 118 |
</ul>
|
| 119 |
""", unsafe_allow_html=True)
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
# Inferential Statistics Section
|
| 122 |
st.subheader("2.2 Inferential Statistics")
|
| 123 |
st.markdown("""
|
| 124 |
Inferential Statistics makes predictions about a population based on sample data.
|
| 125 |
-
""")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import altair as alt
|
| 3 |
+
import pandas as pd
|
| 4 |
|
| 5 |
# Custom CSS for background, fonts, and text styling
|
| 6 |
st.markdown("""
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
+
background-color: #f7f7f7;
|
| 10 |
}
|
| 11 |
h1 {
|
| 12 |
color: #d63384;
|
| 13 |
+
font-family: 'Roboto', sans-serif;
|
| 14 |
font-weight: bold;
|
| 15 |
text-align: center;
|
| 16 |
+
margin-bottom: 20px;
|
| 17 |
}
|
| 18 |
h2 {
|
| 19 |
color: #1f77b4;
|
| 20 |
+
font-family: 'Roboto', sans-serif;
|
| 21 |
font-weight: bold;
|
| 22 |
}
|
| 23 |
h3 {
|
| 24 |
color: #6c757d;
|
| 25 |
+
font-family: 'Roboto', sans-serif;
|
| 26 |
}
|
| 27 |
.custom-subheader {
|
| 28 |
color: #2ca02c;
|
| 29 |
+
font-family: 'Roboto', sans-serif;
|
| 30 |
margin-bottom: 0;
|
| 31 |
}
|
| 32 |
p {
|
|
|
|
| 36 |
}
|
| 37 |
.icon-bullet {
|
| 38 |
list-style-type: none;
|
| 39 |
+
padding-left: 0;
|
| 40 |
}
|
| 41 |
.icon-bullet li::before {
|
| 42 |
content: "✔️";
|
|
|
|
| 45 |
</style>
|
| 46 |
""", unsafe_allow_html=True)
|
| 47 |
|
| 48 |
+
# Sidebar for navigation
|
| 49 |
+
st.sidebar.title("Navigation")
|
| 50 |
+
st.sidebar.markdown("Use the sidebar to navigate through different sections.")
|
| 51 |
+
|
| 52 |
# Title Section
|
| 53 |
st.title(":red[**1 : INTRODUCTION TO STATISTICS**]")
|
| 54 |
st.markdown("""
|
| 55 |
In this field, we will be dealing with data using the programming language Python. The term **DATA ANALYSIS** itself indicates working with data. We will collect, clean, and analyze the data to gain insights. Let's first understand the term *data*.
|
| 56 |
+
""", unsafe_allow_html=True)
|
| 57 |
|
| 58 |
# Header Section
|
| 59 |
st.header("*What does the term data refer to?*")
|
|
|
|
| 71 |
</ul>
|
| 72 |
""", unsafe_allow_html=True)
|
| 73 |
|
| 74 |
+
# Data Classification Section with a chart
|
| 75 |
st.header("DATA is classified into 3 types.")
|
| 76 |
st.subheader("**Structured Data**")
|
| 77 |
st.markdown("""
|
|
|
|
| 83 |
""", unsafe_allow_html=True)
|
| 84 |
st.image('https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/dSbyOXaQ6N_Kg2TLxgEyt.png', width=400)
|
| 85 |
|
| 86 |
+
# Visualization example for Structured Data
|
| 87 |
+
data = pd.DataFrame({
|
| 88 |
+
'Category': ['Excel', 'SQL', 'CSV', 'JSON'],
|
| 89 |
+
'Count': [45, 35, 30, 40]
|
| 90 |
+
})
|
| 91 |
+
chart = alt.Chart(data).mark_bar().encode(
|
| 92 |
+
x='Category',
|
| 93 |
+
y='Count',
|
| 94 |
+
color='Category'
|
| 95 |
+
).properties(
|
| 96 |
+
title='Structured Data Types',
|
| 97 |
+
width=500
|
| 98 |
+
)
|
| 99 |
+
st.altair_chart(chart)
|
| 100 |
+
|
| 101 |
st.subheader("**Unstructured Data**")
|
| 102 |
st.markdown("""
|
| 103 |
This type of data is not organized in a predefined manner. Examples include:
|
|
|
|
| 128 |
_Statistics is a branch of mathematics focused on collecting, analyzing, interpreting, and structuring data. It is classified into two types:_
|
| 129 |
""")
|
| 130 |
|
| 131 |
+
# Descriptive Statistics Section with interactive elements
|
| 132 |
st.subheader("2.1 Descriptive Statistics")
|
| 133 |
st.markdown("""
|
| 134 |
Descriptive Statistics describes the main features of data. It can be performed on sample data as well as population data. Key concepts include:
|
|
|
|
| 139 |
</ul>
|
| 140 |
""", unsafe_allow_html=True)
|
| 141 |
|
| 142 |
+
# Example of an interactive chart for Central Tendency
|
| 143 |
+
values = st.slider('Select a range of values', 0, 100, (25, 75))
|
| 144 |
+
mean_value = sum(values) / len(values)
|
| 145 |
+
st.write(f"Mean Value: {mean_value}")
|
| 146 |
+
|
| 147 |
# Inferential Statistics Section
|
| 148 |
st.subheader("2.2 Inferential Statistics")
|
| 149 |
st.markdown("""
|
| 150 |
Inferential Statistics makes predictions about a population based on sample data.
|
| 151 |
+
""")
|