import streamlit as st import seaborn as sns import plotly.express as px import matplotlib.pyplot as plt from PIL import Image import pandas as pd st.set_page_config(layout='wide', page_title='FIFA 2022 EDA', initial_sidebar_state="expanded") def run(): # title st.title("FIFA 2022 Player Rating Prediction") # subheader st.subheader('EDA untuk Analysis dataset FIFA 2022') # add image image = Image.open('soccer.jpg') st.image(image, caption='FIFA 2022') # add description st.write('###### Page ini dibuat oleh **Ardi** sebagai bahan latihan') # membuat garis lurus st.markdown('---') # 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 bar st.write('### Attacking Work Rate') fig = plt.figure(figsize=(15,6)) sns.countplot(x='AttackingWorkRate', data=data) st.pyplot(fig) # membuat histogram st.write('### Overall Rating distribution') fig = plt.figure(figsize=(15,6)) sns.histplot(data['Overall'], bins=30, kde=True) st.pyplot(fig) # membuat histogram dinamis st.write('### Histogram based on Input') kolom = st.selectbox('Pilih Kolom: ', ('Age','Weight', 'Height', 'ShootingTotal')) fig = plt.figure(figsize=(15, 7)) sns.histplot(data[kolom], bins=30, kde=True) st.pyplot(fig) # membuat plotly plot st.write('### Plotly - Overall Rating vs ValueEUR') fig = px.scatter(data, x='ValueEUR', y='Overall', hover_data=['Name','Age']) st.plotly_chart(fig) if __name__ == '__main__': run()