| import streamlit as st
|
| import pandas as pd
|
| import seaborn as sns
|
| import plotly.express as px
|
| import matplotlib.pyplot as plt
|
| from PIL import Image
|
|
|
| def run():
|
| st.title('Apliklasi Prediksi Rating Pemain FIFA 2022')
|
| st.subheader('Page mengenai eksploratory data analysis dari data set FIFA 2022')
|
|
|
| image = Image.open('image_balls.jpg')
|
| st.image(image, caption='FIFA 2022')
|
|
|
| st.write('Hello world! Ini Agung')
|
| st.write('# Title 1')
|
| st.write('## Title 2')
|
| st.write('### Title 3')
|
|
|
|
|
| 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)
|
|
|
|
|
| st.write('### Plot AttackingWorkRate')
|
| fig = plt.figure(figsize=(15,5))
|
| sns.countplot(x='AttackingWorkRate', data=df)
|
| st.pyplot(fig)
|
|
|
|
|
| st.write('### Plot Rating')
|
| fig = plt.figure(figsize=(15,5))
|
| sns.histplot(df['Overall'], bins=30, kde=True)
|
| st.pyplot(fig)
|
|
|
|
|
| st.write('### Histogram berdasarkan input user')
|
| 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)
|
|
|
|
|
| st.write('### Perbandingan antara ValueEUR dengan Overall')
|
| fig = px.scatter(df, x='ValueEUR', y='Overall', hover_data=['Name', 'Age'])
|
| st.plotly_chart(fig)
|
|
|
|
|
|
|
| if __name__ == '__main__':
|
| run() |