Spaces:
Sleeping
Sleeping
import streamlit as st | |
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
import plotly.express as px | |
st.set_page_config( | |
page_title = 'FIFA 2022 - EDA', | |
layout='wide', | |
initial_sidebar_state='expanded' | |
) | |
def run(): | |
# Membuat title | |
st.title('Fifa 2022 Player Rating Prediction') | |
# Membuat Subheader | |
st.subheader('EDA untuk Analisis Dataset FIFA 2022') | |
# Menambah Gambar | |
st.image('https://digitalhub.fifa.com/transform/34dd7fb5-4887-4015-b61d-bbbf6bdfa34a/Argentina-v-France-Final-FIFA-World-Cup-Qatar-2022?&io=transform:fill,aspectratio:16x9&quality=75', | |
caption= 'World Cup Champion') | |
# Menambah Deskripsi | |
st.write('Page ini dibuat oleh gigis') | |
st.write('#Head') | |
st.write('##SubHeader') | |
st.write('###SubSubHeader') | |
# membuat garis lurus | |
st.markdown('---') | |
# Magic syntax | |
''' | |
Pada page ini, penulis akan melakukan explorasi sederhana | |
dataset yang digunakan adalah dataset fifa | |
dataset ini diambil dari sofia.com | |
''' | |
# show dataframe | |
df = pd.read_csv('https://raw.githubusercontent.com/FTDS-learning-materials/phase-1/master/w1/P1W1D1PM%20-%20Machine%20Learning%20Problem%20Framing.csv') | |
st.dataframe(df) | |
# Membuat Barplot | |
st.write('### Plot AttackingWorkRate') | |
fig = plt.figure(figsize=[15,5]) | |
sns.countplot(x='AttackingWorkRate', data=df) | |
st.pyplot(fig) | |
# membuat histogram berdasarkan input user | |
st.write('### Histogram berdasarkan pilihanmu') | |
pilihan= st.selectbox('pilih features:',('Age','Height','Weight')) | |
fig = plt.figure(figsize= (15,5)) | |
sns.histplot(df[pilihan], bins=30, kde=True) | |
st.pyplot(fig) | |
# membuat plot | |
st.write('### Plot antara ValueEUR dengan Price') | |
fig= px.scatter(df,x='ValueEUR',y='Overall', hover_data=['Name','Age']) | |
st.plotly_chart(fig) | |
if __name__ == '__main__': | |
run() |