File size: 1,765 Bytes
58f46f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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():
    st.title("FIFA 2022 Player Rating Prediction")

    st.subheader('EDA untuk Analisis Dataset FIFA 2022')

    st.image('https://e2e85xpajrr.exactdn.com/wp-content/uploads/2022/09/21190008/shutterstock_2190840355-scaled.jpg?strip=all&lossy=1&ssl=1', 
             caption='World Cup Champion')

    st.write('Page ini dibuat oleh Vincent')
    st.write('# Head')
    st.write('## SubHeader')
    st.write('### SubsubHeader')

    st.markdown('---')

    '''
    Pada page ini, penulis akan melakukan eksplorasi sederhana, Dataset yang digunakan adalah dataset FIFA 2022. 
    Dataset ini berasal dari web [sofia.com](www.google.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)

    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 pilihan-mu')
    pilihan = st.selectbox('Pilih feature: ',('Age','Height','Weight'))
    fig = plt.figure(figsize= (15,5))
    sns.histplot(df[pilihan], bins = 30, kde = True)
    st.pyplot(fig)

    # Membuat plotlt 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()