File size: 1,555 Bytes
32f44b9 |
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
import streamlit as st
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.express as px
from PIL import Image
def run():
#Membuat title
st.title('Credit Cards Simulation')
#Tambahkan gambar
image = Image.open('CC.jpeg')
st.image(image, caption = 'Credit Cards')
#Menambahkan deskripsi
st.write('Page ini dibuat oleh Mardhya Malik Nurbani')
#Membuat garis
st.markdown('----')
#Masukkan pandas dataframe
#Show dataframe
df = pd.read_csv('P1G5_Set_1_mardhya.csv')
st.dataframe(df)
#Membuat bar plot
# st.write('#### Plot AttackingWorkRate')
# fig = plt.figure(figsize=(15,5))
# sns.countplot(x='AttackingWorkRate', data = df)
# st.pyplot(fig)
# #Membuat histogram
# st.write('#### Histogram of Age')
# fig = plt.figure(figsize=(15,5))
# sns.histplot(df['Overall'], bins = 30, kde = True)
# st.pyplot(fig)
# #membuat histogram berdasarkan inputan user
# st.write('#### Histogram berdasarkan input user')
# #kalo mau pake radio button, ganti selectbox jadi radio
# option = st.selectbox('Pilih Column : ', ('Age', 'Weight', 'Height', 'ShootingTotal'))
# fig = plt.figure(figsize= (15,5))
# sns.histplot(df[option], bins = 30, kde = True)
# st.pyplot(fig)
# #Membuat Plotly plot
# st.write('#### Plotly Plot - ValueEUR vs Overall')
# fig = px.scatter(df, x = 'ValueEUR', y = 'Overall', hover_data = ['Name', 'Age'])
# st.plotly_chart(fig)
if __name__ == '__main__':
run()
|