Spaces:
Runtime error
Runtime error
Commit
路
244d0dd
1
Parent(s):
d8e3643
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,7 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
86 |
try:
|
87 |
# Buscar la informaci贸n del perfil de usuario
|
88 |
user = api.get_user(screen_name=search_words)
|
89 |
-
st.text(f"La cuenta
|
90 |
tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
|
91 |
result = []
|
92 |
for tweet in tweets:
|
@@ -109,10 +109,10 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
109 |
tabla.append(muestra)
|
110 |
resultado=df.groupby('Prediccion')['Probabilidad'].sum()
|
111 |
colores=["#aae977","#EE3555"]
|
112 |
-
fig, ax = plt.subplots(figsize=(
|
113 |
plt.pie(resultado,labels=resultado.index,autopct='%1.1f%%',colors=colores)
|
114 |
-
ax.set_title("Porcentajes por Categorias", fontsize=
|
115 |
-
plt.rcParams.update({'font.size':
|
116 |
ax.legend()
|
117 |
# Muestra el gr谩fico
|
118 |
plt.show()
|
@@ -122,7 +122,7 @@ def analizar_tweets(search_words, number_of_tweets):
|
|
122 |
muestra = st.text("No hay tweets a analizar")
|
123 |
tabla.append(muestra)
|
124 |
except Exception as e:
|
125 |
-
st.text(f"La cuenta
|
126 |
|
127 |
else:
|
128 |
muestra = st.text("Ingrese los parametros correspondientes")
|
@@ -163,9 +163,9 @@ def tweets_localidad(buscar_localidad):
|
|
163 |
resultado=df.groupby('Prediccion')['Probabilidad'].sum()
|
164 |
colores=["#aae977","#EE3555"]
|
165 |
fig, ax = plt.subplots()
|
166 |
-
fig.set_size_inches(
|
167 |
plt.pie(resultado,labels=resultado.index,autopct='%1.1f%%',colors=colores)
|
168 |
-
ax.set_title("Porcentajes por Categorias", fontsize=
|
169 |
plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
|
170 |
ax.legend()
|
171 |
# Muestra el gr谩fico
|
|
|
86 |
try:
|
87 |
# Buscar la informaci贸n del perfil de usuario
|
88 |
user = api.get_user(screen_name=search_words)
|
89 |
+
st.text(f"La cuenta {search_words} existe.")
|
90 |
tweets = api.user_timeline(screen_name = search_words,tweet_mode="extended", count= number_of_tweets)
|
91 |
result = []
|
92 |
for tweet in tweets:
|
|
|
109 |
tabla.append(muestra)
|
110 |
resultado=df.groupby('Prediccion')['Probabilidad'].sum()
|
111 |
colores=["#aae977","#EE3555"]
|
112 |
+
fig, ax = plt.subplots(figsize=(2, 1), subplotpars=None)
|
113 |
plt.pie(resultado,labels=resultado.index,autopct='%1.1f%%',colors=colores)
|
114 |
+
ax.set_title("Porcentajes por Categorias", fontsize=5, fontweight="bold")
|
115 |
+
plt.rcParams.update({'font.size':5, 'font.weight':'bold'})
|
116 |
ax.legend()
|
117 |
# Muestra el gr谩fico
|
118 |
plt.show()
|
|
|
122 |
muestra = st.text("No hay tweets a analizar")
|
123 |
tabla.append(muestra)
|
124 |
except Exception as e:
|
125 |
+
st.text(f"La cuenta {search_words} no existe.")
|
126 |
|
127 |
else:
|
128 |
muestra = st.text("Ingrese los parametros correspondientes")
|
|
|
163 |
resultado=df.groupby('Prediccion')['Probabilidad'].sum()
|
164 |
colores=["#aae977","#EE3555"]
|
165 |
fig, ax = plt.subplots()
|
166 |
+
fig.set_size_inches(2, 1)
|
167 |
plt.pie(resultado,labels=resultado.index,autopct='%1.1f%%',colors=colores)
|
168 |
+
ax.set_title("Porcentajes por Categorias", fontsize=5, fontweight="bold")
|
169 |
plt.rcParams.update({'font.size':4, 'font.weight':'bold'})
|
170 |
ax.legend()
|
171 |
# Muestra el gr谩fico
|