-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexplore.py
36 lines (31 loc) · 1.03 KB
/
explore.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# import cufflinks as cf
# import plotly.offline
# cf.go_offline()
# cf.set_config_file(offline=False, world_readable=True)
# import plotly
# import plotly.express as px
# import plotly.graph_objs as go
# import plotly.offline as py
# from plotly.offline import iplot
# from plotly.subplots import make_subplots
# import plotly.figure_factory as ff
@st.cache
def loaddata():
with open('heart.csv','rb') as file:
df = pd.read_csv('heart.csv')
return df
df = loaddata()
def show_explore_page():
st.title("Explore Data")
st.markdown("### Data collected from [**Heart Failure Prediction Dataset**](https://www.kaggle.com/fedesoriano/heart-failure-prediction)")
data = df["RestingECG"].value_counts()
fig1, ax1 = plt.subplots()
ax1.pie(data, labels=data.index, autopct="%1.1f%%", startangle=90)
ax1.axis("equal")
st.markdown("#### Types of Resting ECG paitent have")
st.pyplot(fig1)
st.markdown("---")