Spaces:
Runtime error
Runtime error
File size: 1,688 Bytes
fa71090 |
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 57 58 59 |
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
st.set_page_config(
page_title='FIFA 2022',
layout = 'wide',
initial_sidebar_state='expanded'
)
def run():
# membuat title
st.title('FIFA 2022 Player Rating Prediction')
# membuat sub header
st.subheader ('EDA untuk Analisa Dataset FIFA 2022')
# Menambahkan Gambar
image = Image.open('soccer.jpg')
st.image(image,caption = 'FIFA 2022')
# Menambahkan Deskripsi
st.write('Page ini dibuat oleh')
st.write('# Halo')
# show dataframe
data = pd.read_csv('https://raw.githubusercontent.com/ardhiraka/FSDS_Guidelines/master/p1/v3/w1/P1W1D1PM%20-%20Machine%20Learning%20Problem%20Framing.csv')
st.dataframe(data)
# membuat barplot
st.write('#### Plot AttackingWorkRate')
fig =plt.figure(figsize=(15,5))
sns.countplot(x='AttackingWorkRate',data=data)
st.pyplot(fig)
# Membuat histogram
st.write('### Histogram of Rating')
fig = plt.figure(figsize=(15,5))
sns.histplot(data['Overall'],bins=30,kde=True)
st.pyplot(fig)
# Membuat Plotly Plot
st.write('#### PlotlyPlots - ValueEUR dengan Overall')
fig = px.scatter(data, x='ValueEUR', y='Overall',hover_data=['Name','Age'])
st.plotly_chart(fig)
# Membuat histogram berdasarkan input user
st.write('### Histogram berdasarkan input user')
pilihan = st.selectbox('Pilih column :',('Age','Weight','Height','ShootingTotal'))
fig = plt.figure(figsize=(15,5))
sns.histplot(data[pilihan],bins=30,kde=True)
st.pyplot(fig)
if __name__ == '__main__':
run() |