Spaces:
Sleeping
Sleeping
File size: 1,891 Bytes
a0ae618 |
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 64 65 66 67 68 69 70 71 72 73 74 75 |
import streamlit as st
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from PIL import Image
# Set page config
st.set_page_config(
page_title = 'NBA_EDA',
layout='wide',
initial_sidebar_state='expanded'
)
# Create function for eda
def run():
# Create title
st.title('NBA Player Return Prediction')
# Create sub header
st.subheader('EDA untuk Analisis Dataset NBA')
# Add image
st.image('https://pbs.twimg.com/profile_images/1745324889009987584/JGBvQa17_200x200.png'
,caption='NBA Logo')
# Create a description
st.write('Dibuat Oleh Daffa')
st.write('# Deskripsi 1')
st.write('## Deskripsi 2')
st.write('### Deskripsi 3')
# Magic Syntax
'''
Pada page kali ini, penulis akan melakukan eksplorasi sederhana,
Dataset yang digunakan adalah NBA dari tahun 2004.
Dataset ini berasal dari web kaggle.com
'''
# Create straight line
st.markdown('---')
# Show dataframe
df = pd.read_csv('ranking.csv')
st.dataframe(df)
# Create Barplot
st.write('### Plot WinPercentage')
popularity = df.groupby(['TEAM','G'])['W_PCT'].mean().sort_values().reset_index()
fig = plt.figure(figsize=(15,5))
sns.barplot(data=popularity, y='TEAM', orient='h', x='G')
st.pyplot(fig)
# Statement Barchart using Magic Syntax
'''
Medium ada xxxxx Low ada High ada xxxx...
'''
#
# Create Histogram
st.write('### Barplot Berdasarkan Losses')
fig = plt.figure(figsize=(15,5))
# definisikan popularitas
aw = df.groupby(['TEAM','L'])['W_PCT'].mean().sort_values().reset_index()
# buat graf dengan filter yang diinginkan
sns.barplot(data=aw, y='TEAM', orient='h', x='L')
st.pyplot(fig)
# Statement Histogram
'''
Age normal distribusi...
'''
if __name__ == '__main__':
run() |