Joshua1808 commited on
Commit
42e72ae
·
1 Parent(s): 645e710

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -155,7 +155,7 @@ 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'].value_counts()
159
  colores=["#EE3555","#aae977"]
160
  fig, ax = plt.subplots()
161
  fig.set_size_inches(2, 2)
@@ -168,15 +168,15 @@ def tweets_localidad(buscar_localidad):
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")
173
- #plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
174
- #ax.set_xlabel("Categoría")
175
- #ax.set_ylabel("Probabilidad")
176
  # Muestra el gráfico
177
- #plt.show()
178
- #st.set_option('deprecation.showPyplotGlobalUse', False)
179
- #st.pyplot()
180
 
181
  except AttributeError as e:
182
  muestra=st.text("No existe ninguna localidad con ese nombre")
 
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)
 
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")
173
+ plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
174
+ ax.set_xlabel("Categoría")
175
+ ax.set_ylabel("Probabilidad")
176
  # Muestra el gráfico
177
+ plt.show()
178
+ st.set_option('deprecation.showPyplotGlobalUse', False)
179
+ st.pyplot()
180
 
181
  except AttributeError as e:
182
  muestra=st.text("No existe ninguna localidad con ese nombre")