Spaces:
Runtime error
Runtime error
Commit
·
42e72ae
1
Parent(s):
645e710
Update app.py
Browse files
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 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
# Muestra el gráfico
|
177 |
-
|
178 |
-
|
179 |
-
|
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")
|