Joshua1808 commited on
Commit
3fc23ca
1 Parent(s): 42e72ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -13
app.py CHANGED
@@ -55,6 +55,7 @@ def color_survived(val):
55
  st.set_page_config(layout="wide")
56
  st.markdown('<style>body{background-color: Blue;}</style>',unsafe_allow_html=True)
57
 
 
58
  #colT1,colT2 = st.columns([2,8])
59
  st.markdown(""" <style> .fondo {
60
  background-image: url("https://www.google.com/url?sa=i&url=https%3A%2F%2Flasmujereseneldeportemexicano.wordpress.com%2F2016%2F11%2F17%2Fpor-que-es-importante-hablar-de-genero%2F&psig=AOvVaw0xG7SVXtJoEpwt-fF5Kykt&ust=1676431557056000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCJiu-a6IlP0CFQAAAAAdAAAAABAJ");
@@ -66,7 +67,7 @@ st.markdown(""" <style> .font {
66
  font-size:40px ; font-family: 'Cooper Black'; color: #301E67;}
67
  </style> """, unsafe_allow_html=True)
68
 
69
- st.markdown('<p class="font fondo">Detectando el Sexismo en L铆nea: Un Proyecto de Investigaci贸n</p>', unsafe_allow_html=True)
70
 
71
  st.markdown(""" <style> .font1 {
72
  font-size:28px ; font-family: 'Times New Roman'; color: #8d33ff;}
@@ -155,18 +156,19 @@ def tweets_localidad(buscar_localidad):
155
  muestra = st.table(df.reset_index(drop=True).head(10).style.applymap(color_survived, subset=['Prediccion']))
156
  tabla.append(muestra)
157
  #resultado=df.groupby('Prediccion')['Probabilidad'].sum()
158
- resultado = df['Prediccion'].head(10).value_counts()
159
- colores=["#EE3555","#aae977"]
160
- fig, ax = plt.subplots()
161
- fig.set_size_inches(2, 2)
162
- plt.pie(resultado,labels=resultado.index,autopct='%1.1f%%',colors=colores, textprops={'fontsize': 4})
163
- ax.set_title("Porcentajes por Categorias", fontsize=5, fontweight="bold")
164
- plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
165
- ax.legend()
166
- # Muestra el gr谩fico
167
- plt.show()
168
- st.set_option('deprecation.showPyplotGlobalUse', False)
169
- st.pyplot()
 
170
 
171
  plt.bar(resultado.index, resultado, color=colores)
172
  ax.set_title("Porcentajes por Categorias", fontsize=5, fontweight="bold")
 
55
  st.set_page_config(layout="wide")
56
  st.markdown('<style>body{background-color: Blue;}</style>',unsafe_allow_html=True)
57
 
58
+ #st.markdown('<style>body{background-color: Blue;}</style>',unsafe_allow_html=True)
59
  #colT1,colT2 = st.columns([2,8])
60
  st.markdown(""" <style> .fondo {
61
  background-image: url("https://www.google.com/url?sa=i&url=https%3A%2F%2Flasmujereseneldeportemexicano.wordpress.com%2F2016%2F11%2F17%2Fpor-que-es-importante-hablar-de-genero%2F&psig=AOvVaw0xG7SVXtJoEpwt-fF5Kykt&ust=1676431557056000&source=images&cd=vfe&ved=0CBAQjRxqFwoTCJiu-a6IlP0CFQAAAAAdAAAAABAJ");
 
67
  font-size:40px ; font-family: 'Cooper Black'; color: #301E67;}
68
  </style> """, unsafe_allow_html=True)
69
 
70
+ st.markdown('<p class="font">Detectando el Sexismo en L铆nea: Un Proyecto de Investigaci贸n</p>', unsafe_allow_html=True)
71
 
72
  st.markdown(""" <style> .font1 {
73
  font-size:28px ; font-family: 'Times New Roman'; color: #8d33ff;}
 
156
  muestra = st.table(df.reset_index(drop=True).head(10).style.applymap(color_survived, subset=['Prediccion']))
157
  tabla.append(muestra)
158
  #resultado=df.groupby('Prediccion')['Probabilidad'].sum()
159
+ with st.container():
160
+ resultado = df['Prediccion'].head(10).value_counts()
161
+ colores=["#EE3555","#aae977"]
162
+ fig, ax = plt.subplots()
163
+ fig.set_size_inches(2, 2)
164
+ plt.pie(resultado,labels=resultado.index,autopct='%1.1f%%',colors=colores, textprops={'fontsize': 4})
165
+ ax.set_title("Porcentajes por Categorias", fontsize=5, fontweight="bold")
166
+ plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
167
+ ax.legend()
168
+ # Muestra el gr谩fico
169
+ plt.show()
170
+ st.set_option('deprecation.showPyplotGlobalUse', False)
171
+ st.pyplot()
172
 
173
  plt.bar(resultado.index, resultado, color=colores)
174
  ax.set_title("Porcentajes por Categorias", fontsize=5, fontweight="bold")