File size: 1,974 Bytes
9a005e8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
58
59
60
61
62
63
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()