import streamlit as st import pandas as pd import numpy as np import matplotlib.pyplot as plt import random st.markdown(""" """, 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(""" """,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. """,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")