-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (48 loc) · 1.4 KB
/
main.py
File metadata and controls
62 lines (48 loc) · 1.4 KB
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
import streamlit as st
import src.streamlit as dat
import pandas as pd
import streamlit.components.v1 as components
from PIL import Image
import plotly.express as px
st.set_page_config(layout="wide")
st.set_option('deprecation.showPyplotGlobalUse', False)
st.write("""
# What happen if we apply geography knowledge to basketball?
""")
portada = Image.open("./images/gasol.jpeg")
st.image(portada)
st.write("""
## Choose a cluster:
""")
cluster = st.selectbox(
"Choose a cluster", dat.lista_clusters()
)
col1,col2=st.beta_columns(2)
with col1:
datagraf = dat.grafico_cl(cluster)
fig = px.scatter(datagraf, x="PTS", y="FG%", hover_name = "PLAYER_NAME", color = "Team", size = "MIN")
st.plotly_chart(fig)
with col2:
description = dat.cluster_description(cluster)
st.table(description)
st.write("""
## Choose a player from this cluster:
""")
persona = st.selectbox(
"Choose a player:", list(datagraf.PLAYER_NAME.unique())
)
col3,col4=st.beta_columns(2)
with col3:
dat.statsbomb(persona)
imagen = Image.open("./images/plot.png")
imagen = imagen.resize((800,1000),Image.ANTIALIAS)
st.image(imagen)
with col4:
persona = persona.split(" ")[-1]
long_names = dat.lista_tiradores()
for i in long_names:
if persona in i:
dat.mapa(i)
imagen = Image.open("./images/map.png")
imagen = imagen.rotate(90)
st.image(imagen)