|
|
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(): |
|
|
|
|
|
st.title('FIFA 2022 Player Rating Prediction') |
|
|
|
|
|
|
|
|
st.subheader('EDA untuk Analisa Dataset FIFA 2022') |
|
|
|
|
|
image = Image.open('gambar.jpg') |
|
|
st.image(image, caption='FIFA 2022') |
|
|
|
|
|
|
|
|
st.write('Page ini dibuat oleh Theo Nugraha') |
|
|
st.write('# Teks 1') |
|
|
st.write('## Teks 2') |
|
|
st.write('### Teks 3') |
|
|
|
|
|
|
|
|
st.markdown('---') |
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
st.write('#### Plot AttackingWorkRate') |
|
|
fig = plt.figure(figsize=(15, 5)) |
|
|
sns.countplot(x='AttackingWorkRate', data=data) |
|
|
st.pyplot(fig) |
|
|
|
|
|
|
|
|
st.write('#### Histogram of Rating') |
|
|
fig = plt.figure(figsize=(15, 5)) |
|
|
sns.histplot(data['Overall'], bins=30, kde=True) |
|
|
st.pyplot(fig) |
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
|
|
|
st.write('#### Plotly Plot - ValueEUR dengan Overall') |
|
|
fig = px.scatter(data, x='ValueEUR', y='Overall', hover_data=['Name', 'Age']) |
|
|
st.plotly_chart(fig) |
|
|
|
|
|
if __name__ == '__main__': |
|
|
run() |