DOMMETI's picture
Update app.py
8bd017a verified
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import random
st.markdown("""
<style>
/* Set a soft background color */
body {
background-color: #eef2f7;
}
/* Style for main title */
h1 {
color: #00FFFF;
font-family: 'Roboto', sans-serif;
font-weight: 700;
text-align: center;
margin-bottom: 25px;
}
/* Style for headers */
h2 {
color: #FFFACD;
font-family: 'Roboto', sans-serif;
font-weight: 600;
margin-top: 30px;
}
/* Style for subheaders */
h3 {
color: #ba95b0;
font-family: 'Roboto', sans-serif;
font-weight: 500;
margin-top: 20px;
}
.custom-subheader {
color: #00FFFF;
font-family: 'Roboto', sans-serif;
font-weight: 600;
margin-bottom: 15px;
}
/* Paragraph styling */
p {
font-family: 'Georgia', serif;
line-height: 1.8;
color: #FFFFFF; /* Darker text color for better visibility */
margin-bottom: 20px;
}
/* List styling with checkmark bullets */
.icon-bullet {
list-style-type: none;
padding-left: 20px;
}
.icon-bullet li {
font-family: 'Georgia', serif;
font-size: 1.1em;
margin-bottom: 10px;
color: #FFFFF0; /* Darker text color for better visibility */
}
.icon-bullet li::before {
content: "✔️";
padding-right: 10px;
color: #b3b3ff;
}
/* Sidebar styling */
.sidebar .sidebar-content {
background-color: #ffffff;
border-radius: 10px;
padding: 15px;
}
.sidebar h2 {
color: #495057;
}
</style>
""", unsafe_allow_html=True)
st.snow()
st.title('STATISTICS')
st.subheader('What does the term statistics means?')
st.markdown("""It is a huge field in this we are going to deal data.The below mentioned are some of the operations which we will be doing on data""",unsafe_allow_html=True)
st.markdown("""
<ul class="icon-bullet">
<li>Collecting</li>
<li>Interpreting</li>
<li>Analysis</li>
<li>Structuring</li>
</ul>""",unsafe_allow_html=True)
st.title('Terminology')
st.subheader('Experiment')
st.markdown("""It's a simple test or a procedure or an investigation which are carried out to discover what will be the consiquences.Given below is one of the example of experminet.
""",unsafe_allow_html=True)
st.title("Drug Trial Analysis Between Covaxine and Covishiled")
total_participants = st.number_input("Total Participants For Covaxine:", min_value=100, max_value=10000, value=1000)
total_participants_1 = st.number_input("Total Participants For Covishield:", min_value=100, max_value=1000, value=1000)
side_effects_drug_1 = st.number_input("Number of Side Effects in Covaxine:", min_value=0, max_value=10000, value=100)
side_effects_drug_2 = st.number_input("Number of Side Effects in Covishield:", min_value=0, max_value=10000, value=20)
p_side_effects_drug_1 = (side_effects_drug_1 / total_participants)*100
p_side_effects_drug_2 = (side_effects_drug_2 / total_participants_1)*100
st.subheader("Results:")
st.write(f"Probability of Side Effects in Covaxine: {p_side_effects_drug_1}%")
st.write(f"Probability of Side Effects in Covishield: {p_side_effects_drug_2}%")
fig,axis=plt.subplots()
axis.pie(x=[p_side_effects_drug_1,p_side_effects_drug_2],labels=['covaxine','covishield'],autopct="%0.1f%%")
st.pyplot(fig)
st.subheader("Random Experiment")
st.markdown("""A random experiment is also an experiment bt in order to become a random experiment it show satisfy 2 condition's.
<ul class="icon-bullet">
<li>It show have more than one outcome.</li>
<li>We cannot predict what will be the outcome of the experiment.</li>
</ul>
""",unsafe_allow_html=True)
st.title("Random Experiment:Will it rain or not")
st.write("""
This simple experiment simulates a random prediction will it rain or not. Each time you click the button you will get a random result that it will rain or not.
""")
if st.button('Will it rain or not'):
result = random.choice(['Rain','NoRain'])
st.write(f"The result is: **{result}**")
st.subheader("Trail")
st.markdown("""A single execution of random experiment""")
st.title("Random Experiment:Will it rain or not with respect to trail")
st.write("""
This simple experiment simulates a random prediction will it rain or not with respect to trail. Each time you click the button you will get a random result that it will rain or not.
""")
Trail = st.number_input("Number of Trials:", min_value=1, max_value=100, value=7)
if st.button('Start the Experiment: Will it Rain or Not?'):
st.write(f"Running {Trail} trials...")
for i in range(1, Trail + 1):
result = random.choice(['Rain', 'No Rain'])
st.write(f"Trial {i}: **{result}**")
st.subheader("Outcome")
st.markdown("""Outcome is nothing but result of a trail.""",unsafe_allow_html=True)
st.subheader("Sample Space")
st.markdown("""Set of all possible outcome of Sample Space..""",unsafe_allow_html=True)
st.title("Example of Sample Space")
st.write("""
This simple experiment simulates a random prediction will it rain or not with respect to trail and will tell you about sample space.
""")
Trail_1 = st.number_input("Number of Trials:", min_value=1, max_value=100, value=7,key="Trail_1")
if st.button('Start the Experiment: Will it Rain or Not?',key="start_experiment"):
st.write(f"Running {Trail_1} trials...")
list1=[]
for i in range(1, Trail_1 + 1):
result = random.choice(['Rain', 'No Rain'])
list1+=[result]
st.write(f"Sample_Space:{np.unique(list1)}")
st.subheader("Event")
st.markdown("It's a subset of sample space or in easy term's the question's raised on a random experiemnt.",unsafe_allow_html=True)
st.write("""
This simple experiment simulates a random prediction will it rain or not with respect to trail and will tell you about event.
""")
st.title("Example of an Event")
Trail_2 = st.number_input("Number of Trials:", min_value=1, max_value=100, value=7,key="Trail_2")
if st.button('Start the Experiment: Will it Rain or Not?',key="start_experiment_1"):
st.write(f"Running {Trail_2} trials...")
list1=[]
for i in range(1, Trail_2 + 1):
result = random.choice(['Rain', 'No Rain'])
list1+=[result]
st.write(f"Sample_Space:{np.unique(list1)}")
st.write(f"Event_1 Chance of Rain: Rain")
st.write(f"Event_2 Chance of No Rain: No_Rain")
st.write(f"Both Event_1 and Event_2 are subset of sample space")