DOMMETI commited on
Commit
b52c683
·
verified ·
1 Parent(s): 7454ffb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +74 -48
app.py CHANGED
@@ -5,49 +5,69 @@ import pandas as pd
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
- margin-top: 20px;
23
  }
24
  h3 {
25
  color: #6c757d;
26
  font-family: 'Roboto', sans-serif;
27
- margin-top: 15px;
 
28
  }
 
29
  .custom-subheader {
30
  color: #2ca02c;
31
  font-family: 'Roboto', sans-serif;
32
- margin-bottom: 10px;
 
33
  }
 
34
  p {
35
  font-family: 'Georgia', serif;
36
- line-height: 1.6;
37
- color: #343a40;
38
- margin-bottom: 15px;
39
  }
 
40
  .icon-bullet {
41
  list-style-type: none;
42
- padding-left: 0;
43
- margin-bottom: 15px;
44
  }
45
  .icon-bullet li {
46
- margin-bottom: 8px;
 
 
 
47
  }
48
  .icon-bullet li::before {
49
  content: "✔️";
50
  padding-right: 10px;
 
 
 
 
 
 
 
 
 
 
51
  }
52
  </style>
53
  """, unsafe_allow_html=True)
@@ -57,36 +77,36 @@ st.sidebar.title("Navigation")
57
  st.sidebar.markdown("Use the sidebar to navigate through different sections.")
58
 
59
  # Title Section
60
- st.title(":red[**1 : INTRODUCTION TO STATISTICS**]")
61
  st.markdown("""
62
- 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*.
63
  """, unsafe_allow_html=True)
64
 
65
  # Header Section
66
- st.header("*What does the term data refer to?*")
67
- st.subheader(":blue[DATA]")
68
 
69
  st.markdown("""
70
- Data is a collection of information gathered from observation. There are many sources of information. Below are some examples:
71
  """, unsafe_allow_html=True)
72
 
73
  st.markdown("""
74
  <ul class="icon-bullet">
75
- <li>IMAGE</li>
76
- <li>TEXT</li>
77
- <li>VIDEO</li>
78
- <li>AUDIO</li>
79
  </ul>
80
  """, unsafe_allow_html=True)
81
 
82
  # Data Classification Section with a chart
83
- st.header("DATA is classified into 3 types.")
84
- st.subheader("**Structured Data**")
85
  st.markdown("""
86
- This type of data is well-organized, typically in rows and columns. Examples include:
87
  <ul class="icon-bullet">
88
- <li>EXCEL DOCUMENT</li>
89
- <li>STRUCTURED QUERY LANGUAGE DATABASE</li>
90
  </ul>
91
  """, unsafe_allow_html=True)
92
 
@@ -98,36 +118,42 @@ data = pd.DataFrame({
98
  'Count': [45, 35, 30, 40]
99
  })
100
  chart = alt.Chart(data).mark_bar().encode(
101
- x='Category',
102
- y='Count',
103
- color='Category'
104
  ).properties(
105
  title='Structured Data Types',
106
- width=500
 
 
 
 
 
 
107
  )
108
  st.altair_chart(chart)
109
 
110
- st.subheader("**Unstructured Data**")
111
  st.markdown("""
112
- This type of data is not organized in a predefined manner. Examples include:
113
  <ul class="icon-bullet">
114
- <li>IMAGE</li>
115
- <li>VIDEO</li>
116
- <li>TEXT</li>
117
  <li>Social Media Feeds</li>
118
  </ul>
119
  """, unsafe_allow_html=True)
120
 
121
  st.image("https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/xhaNBRanDaj8esumqo9hl.png", width=400)
122
 
123
- st.subheader("**Semi-Structured Data**")
124
  st.markdown("""
125
- This data combines elements of both structured and unstructured data. Examples include:
126
  <ul class="icon-bullet">
127
- <li>COMMA SEPARATED VARIABLE (CSV)</li>
128
- <li>JSON FILES</li>
129
- <li>E-MAILS</li>
130
- <li>HTML</li>
131
  </ul>
132
  """, unsafe_allow_html=True)
133
 
@@ -136,17 +162,17 @@ st.image("https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c
136
  # Introduction to Statistics
137
  st.title("2 : INTRODUCTION TO STATISTICS")
138
  st.markdown("""
139
- _Statistics is a branch of mathematics focused on collecting, analyzing, interpreting, and structuring data. It is classified into two types:_
140
  """, unsafe_allow_html=True)
141
 
142
  # Descriptive Statistics Section with interactive elements
143
  st.subheader("2.1 Descriptive Statistics")
144
  st.markdown("""
145
- Descriptive Statistics describes the main features of data. It can be performed on sample data as well as population data. Key concepts include:
146
  <ul class="icon-bullet">
147
- <li>Measurement of Central Tendency (Mean, Median, Mode)</li>
148
- <li>Measurement of Dispersion (Range, Variance, Standard Deviation)</li>
149
- <li>Distribution (e.g., Gaussian, Random, Normal)</li>
150
  </ul>
151
  """, unsafe_allow_html=True)
152
 
@@ -158,5 +184,5 @@ st.write(f"Mean Value: {mean_value}")
158
  # Inferential Statistics Section
159
  st.subheader("2.2 Inferential Statistics")
160
  st.markdown("""
161
- Inferential Statistics makes predictions about a population based on sample data.
162
  """, unsafe_allow_html=True)
 
5
  # Custom CSS for background, fonts, and text styling
6
  st.markdown("""
7
  <style>
8
+ /* Set a soft background color */
9
  body {
10
+ background-color: #eef2f7;
11
  }
12
+ /* Style for main title */
13
  h1 {
14
  color: #d63384;
15
  font-family: 'Roboto', sans-serif;
16
+ font-weight: 700;
17
  text-align: center;
18
+ margin-bottom: 25px;
19
  }
20
+ /* Style for headers */
21
  h2 {
22
  color: #1f77b4;
23
  font-family: 'Roboto', sans-serif;
24
+ font-weight: 600;
25
+ margin-top: 30px;
26
  }
27
  h3 {
28
  color: #6c757d;
29
  font-family: 'Roboto', sans-serif;
30
+ font-weight: 500;
31
+ margin-top: 20px;
32
  }
33
+ /* Style for subheaders */
34
  .custom-subheader {
35
  color: #2ca02c;
36
  font-family: 'Roboto', sans-serif;
37
+ font-weight: 600;
38
+ margin-bottom: 15px;
39
  }
40
+ /* Paragraph styling */
41
  p {
42
  font-family: 'Georgia', serif;
43
+ line-height: 1.8;
44
+ color: #495057;
45
+ margin-bottom: 20px;
46
  }
47
+ /* List styling with checkmark bullets */
48
  .icon-bullet {
49
  list-style-type: none;
50
+ padding-left: 20px;
 
51
  }
52
  .icon-bullet li {
53
+ font-family: 'Georgia', serif;
54
+ font-size: 1.1em;
55
+ margin-bottom: 10px;
56
+ color: #495057;
57
  }
58
  .icon-bullet li::before {
59
  content: "✔️";
60
  padding-right: 10px;
61
+ color: #17a2b8;
62
+ }
63
+ /* Sidebar styling */
64
+ .sidebar .sidebar-content {
65
+ background-color: #ffffff;
66
+ border-radius: 10px;
67
+ padding: 15px;
68
+ }
69
+ .sidebar h2 {
70
+ color: #495057;
71
  }
72
  </style>
73
  """, unsafe_allow_html=True)
 
77
  st.sidebar.markdown("Use the sidebar to navigate through different sections.")
78
 
79
  # Title Section
80
+ st.title("1 : INTRODUCTION TO STATISTICS")
81
  st.markdown("""
82
+ In this section, we'll explore the basics of data analysis using Python. **Data Analysis** involves collecting, cleaning, and analyzing data to extract valuable insights. Let's start by understanding what we mean by *data*.
83
  """, unsafe_allow_html=True)
84
 
85
  # Header Section
86
+ st.header("What does the term 'data' refer to?")
87
+ st.subheader("DATA")
88
 
89
  st.markdown("""
90
+ Data refers to a collection of information gathered from various sources. Here are a few examples:
91
  """, unsafe_allow_html=True)
92
 
93
  st.markdown("""
94
  <ul class="icon-bullet">
95
+ <li>Images</li>
96
+ <li>Text</li>
97
+ <li>Videos</li>
98
+ <li>Audio recordings</li>
99
  </ul>
100
  """, unsafe_allow_html=True)
101
 
102
  # Data Classification Section with a chart
103
+ st.header("Data Classification")
104
+ st.subheader("Structured Data")
105
  st.markdown("""
106
+ Structured data is organized and formatted, making it easy to search, analyze, and store in databases. Common examples include:
107
  <ul class="icon-bullet">
108
+ <li>Excel Documents</li>
109
+ <li>SQL Databases</li>
110
  </ul>
111
  """, unsafe_allow_html=True)
112
 
 
118
  'Count': [45, 35, 30, 40]
119
  })
120
  chart = alt.Chart(data).mark_bar().encode(
121
+ x=alt.X('Category', title='Data Format'),
122
+ y=alt.Y('Count', title='Count'),
123
+ color=alt.Color('Category', legend=None)
124
  ).properties(
125
  title='Structured Data Types',
126
+ width=500,
127
+ height=300
128
+ ).configure_title(
129
+ fontSize=18,
130
+ anchor='middle',
131
+ font='Roboto',
132
+ color='#343a40'
133
  )
134
  st.altair_chart(chart)
135
 
136
+ st.subheader("Unstructured Data")
137
  st.markdown("""
138
+ Unstructured data doesn't follow a specific format and is often difficult to organize. Examples include:
139
  <ul class="icon-bullet">
140
+ <li>Images</li>
141
+ <li>Videos</li>
142
+ <li>Text documents</li>
143
  <li>Social Media Feeds</li>
144
  </ul>
145
  """, unsafe_allow_html=True)
146
 
147
  st.image("https://cdn-uploads.huggingface.co/production/uploads/64c972774515835c4dadd754/xhaNBRanDaj8esumqo9hl.png", width=400)
148
 
149
+ st.subheader("Semi-Structured Data")
150
  st.markdown("""
151
+ Semi-structured data contains elements of both structured and unstructured data. Examples include:
152
  <ul class="icon-bullet">
153
+ <li>CSV Files</li>
154
+ <li>JSON Files</li>
155
+ <li>Emails</li>
156
+ <li>HTML Documents</li>
157
  </ul>
158
  """, unsafe_allow_html=True)
159
 
 
162
  # Introduction to Statistics
163
  st.title("2 : INTRODUCTION TO STATISTICS")
164
  st.markdown("""
165
+ _Statistics is a branch of mathematics focused on collecting, analyzing, interpreting, and presenting data. It can be divided into two main categories:_
166
  """, unsafe_allow_html=True)
167
 
168
  # Descriptive Statistics Section with interactive elements
169
  st.subheader("2.1 Descriptive Statistics")
170
  st.markdown("""
171
+ Descriptive statistics summarize and describe the main features of a dataset. Key concepts include:
172
  <ul class="icon-bullet">
173
+ <li>Measures of Central Tendency (Mean, Median, Mode)</li>
174
+ <li>Measures of Dispersion (Range, Variance, Standard Deviation)</li>
175
+ <li>Data Distributions (e.g., Gaussian, Random, Normal)</li>
176
  </ul>
177
  """, unsafe_allow_html=True)
178
 
 
184
  # Inferential Statistics Section
185
  st.subheader("2.2 Inferential Statistics")
186
  st.markdown("""
187
+ Inferential statistics involve making predictions or inferences about a population based on a sample. These methods are used to test hypotheses and estimate population parameters.
188
  """, unsafe_allow_html=True)