Spaces:
Runtime error
Runtime error
Commit
·
cf4d177
1
Parent(s):
8668a88
Update app.py
Browse files
app.py
CHANGED
@@ -258,20 +258,7 @@ def tweets_localidad(buscar_localidad):
|
|
258 |
#df['Tweets'] = df['Tweets'].apply(lambda x: re.sub(r'[:;][-o^]?[)\]DpP3]|[(/\\]|[\U0001f600-\U0001f64f]|[\U0001f300-\U0001f5ff]|[\U0001f680-\U0001f6ff]|[\U0001f1e0-\U0001f1ff]','', x))
|
259 |
|
260 |
tabla = st.table(df.reset_index(drop=True).head(50).style.applymap(color_survived, subset=['Prediccion']))
|
261 |
-
|
262 |
-
df_sexista = df[df['Sexista']=="Sexista"]
|
263 |
-
df_no_sexista = df[df['Probabilidad'] > 0]
|
264 |
-
sexista = len(df_sexista)
|
265 |
-
no_sexista = len(df_no_sexista)
|
266 |
|
267 |
-
# Crear un gráfico de barras
|
268 |
-
labels = ['Sexista ', ' No sexista']
|
269 |
-
counts = [sexista, no_sexista]
|
270 |
-
plt.bar(labels, counts)
|
271 |
-
plt.xlabel('Categoría')
|
272 |
-
plt.ylabel('Cantidad de tweets')
|
273 |
-
plt.title('Cantidad de tweets sexistas y no sexistas')
|
274 |
-
plt.show()
|
275 |
|
276 |
return df
|
277 |
|
|
|
258 |
#df['Tweets'] = df['Tweets'].apply(lambda x: re.sub(r'[:;][-o^]?[)\]DpP3]|[(/\\]|[\U0001f600-\U0001f64f]|[\U0001f300-\U0001f5ff]|[\U0001f680-\U0001f6ff]|[\U0001f1e0-\U0001f1ff]','', x))
|
259 |
|
260 |
tabla = st.table(df.reset_index(drop=True).head(50).style.applymap(color_survived, subset=['Prediccion']))
|
|
|
|
|
|
|
|
|
|
|
261 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
|
263 |
return df
|
264 |
|