Joshua1808 commited on
Commit
f95ab68
·
1 Parent(s): 9b06f16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -156,14 +156,12 @@ def tweets_localidad(buscar_localidad):
156
  df.sort_values(by='Prediccion', ascending=False, inplace=True)
157
  df['Prediccion'] = np.where(df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
158
  df['Probabilidad'] = df['Probabilidad'].round(3)
159
- muestra = st.table(df.reset_index(drop=True).head(5).style.applymap(color_survived, subset=['Prediccion']))
160
  tab1, tab2 = st.tabs(["📈 Chart", "🗃 Data"])
161
  tab1.subheader("Datos")
162
- tabla.append(muestra)
163
- tab2.write(tabla)
164
-
165
  tab2.subheader("Gráfico")
166
- tab1.line_chart(tabla)
167
  resultado = df['Prediccion'].value_counts()
168
  colores=["#EE3555","#aae977"]
169
  fig, ax = plt.subplots()
@@ -173,9 +171,11 @@ def tweets_localidad(buscar_localidad):
173
  plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
174
  ax.legend()
175
  # Muestra el gráfico
176
- plt.show()
177
- st.set_option('deprecation.showPyplotGlobalUse', False)
178
- st.pyplot()
 
 
179
 
180
  except AttributeError as e:
181
  muestra=st.text("No existe ninguna localidad con ese nombre")
 
156
  df.sort_values(by='Prediccion', ascending=False, inplace=True)
157
  df['Prediccion'] = np.where(df['Prediccion'] == 'LABEL_1', 'Sexista', 'No Sexista')
158
  df['Probabilidad'] = df['Probabilidad'].round(3)
159
+ #muestra = st.table(df.reset_index(drop=True).head(5).style.applymap(color_survived, subset=['Prediccion']))
160
  tab1, tab2 = st.tabs(["📈 Chart", "🗃 Data"])
161
  tab1.subheader("Datos")
162
+ #tabla.append(muestra)
163
+ tab2.write(muestra)
 
164
  tab2.subheader("Gráfico")
 
165
  resultado = df['Prediccion'].value_counts()
166
  colores=["#EE3555","#aae977"]
167
  fig, ax = plt.subplots()
 
171
  plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
172
  ax.legend()
173
  # Muestra el gráfico
174
+ #plt.show()
175
+ #st.set_option('deprecation.showPyplotGlobalUse', False)
176
+ #st.pyplot()
177
+ tab1.st.pyplot()
178
+
179
 
180
  except AttributeError as e:
181
  muestra=st.text("No existe ninguna localidad con ese nombre")