Spaces:
Runtime error
Runtime error
Commit
·
ca86fcc
1
Parent(s):
718659c
ejemplos de graficos
Browse files
app.py
CHANGED
@@ -7,8 +7,8 @@ import streamlit as st
|
|
7 |
from PIL import Image
|
8 |
from sklearn.linear_model import LinearRegression
|
9 |
from streamlit_option_menu import option_menu
|
10 |
-
import
|
11 |
-
|
12 |
# from streamlit.components.v1 import IFrame
|
13 |
|
14 |
image = Image.open('./assets/logo_latam_brain.png')
|
@@ -16,6 +16,8 @@ logo = Image.open('./assets/LatamBrainlogo.png')
|
|
16 |
scrum = Image.open("./assets/Scrum'ProcessLB.png")
|
17 |
dashboard_ejemplo = Image.open('./assets/dashboard_ejemplo.png')
|
18 |
|
|
|
|
|
19 |
st.markdown("""<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
|
20 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>""",
|
21 |
unsafe_allow_html=True)
|
@@ -128,10 +130,6 @@ if selected2 == "Home":
|
|
128 |
col2.markdown(mati, unsafe_allow_html=True)
|
129 |
col3.markdown(catriel, unsafe_allow_html=True)
|
130 |
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
# Pagina Projects
|
136 |
if selected2 == "Projects":
|
137 |
st.markdown('''
|
@@ -168,7 +166,53 @@ En resumen, la industria de la tecnología y la analítica de datos está en con
|
|
168 |
|
169 |
st.image(dashboard_ejemplo, width=700)
|
170 |
|
|
|
|
|
|
|
|
|
171 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
st.markdown('''
|
174 |
<br>
|
@@ -195,7 +239,6 @@ En resumen, el mercado de empleo de datos en Latinoamérica ofrece grandes oport
|
|
195 |
|
196 |
st.image(dashboard_ejemplo, width=700)
|
197 |
|
198 |
-
|
199 |
st.markdown('''
|
200 |
<br>
|
201 |
<h3>Predicción de nuevos puestos de trabajo con ML</h3>
|
@@ -205,11 +248,7 @@ En resumen, el mercado de empleo de datos en Latinoamérica ofrece grandes oport
|
|
205 |
# st.set_page_config(page_title="Predicción de nuevos puestos de trabajo",
|
206 |
# page_icon=":bar_chart:", layout="wide")
|
207 |
|
208 |
-
|
209 |
-
|
210 |
# Cargar los datos
|
211 |
-
df = pd.read_csv(
|
212 |
-
'./ML/ds_salaries.csv')
|
213 |
|
214 |
# Seleccionar las columnas relevantes
|
215 |
df_relevant = df[['job_title', 'work_year']]
|
@@ -347,7 +386,6 @@ En resumen, el mercado de empleo de datos en Latinoamérica ofrece grandes oport
|
|
347 |
#
|
348 |
if selected2 == "New":
|
349 |
|
350 |
-
|
351 |
progress_text = "Operation in progress. Please wait."
|
352 |
my_bar = st.progress(0, text=progress_text)
|
353 |
|
|
|
7 |
from PIL import Image
|
8 |
from sklearn.linear_model import LinearRegression
|
9 |
from streamlit_option_menu import option_menu
|
10 |
+
import plotly.express as px
|
11 |
+
|
12 |
# from streamlit.components.v1 import IFrame
|
13 |
|
14 |
image = Image.open('./assets/logo_latam_brain.png')
|
|
|
16 |
scrum = Image.open("./assets/Scrum'ProcessLB.png")
|
17 |
dashboard_ejemplo = Image.open('./assets/dashboard_ejemplo.png')
|
18 |
|
19 |
+
df = pd.read_csv('./ML/ds_salaries.csv')
|
20 |
+
|
21 |
st.markdown("""<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
|
22 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>""",
|
23 |
unsafe_allow_html=True)
|
|
|
130 |
col2.markdown(mati, unsafe_allow_html=True)
|
131 |
col3.markdown(catriel, unsafe_allow_html=True)
|
132 |
|
|
|
|
|
|
|
|
|
133 |
# Pagina Projects
|
134 |
if selected2 == "Projects":
|
135 |
st.markdown('''
|
|
|
166 |
|
167 |
st.image(dashboard_ejemplo, width=700)
|
168 |
|
169 |
+
# Crea un gráfico
|
170 |
+
st.bar_chart(df['salary'])
|
171 |
+
|
172 |
+
st.title('Ejemplo de gráfico de barras apiladas')
|
173 |
|
174 |
+
chart = alt.Chart(df).mark_bar().encode(
|
175 |
+
x='work_year:N',
|
176 |
+
y='salary:Q',
|
177 |
+
color='categoria:N'
|
178 |
+
).properties(
|
179 |
+
width=700,
|
180 |
+
height=400
|
181 |
+
)
|
182 |
+
|
183 |
+
st.altair_chart(chart, use_container_width=True)
|
184 |
+
|
185 |
+
st.title('Ejemplo de gráfico de líneas')
|
186 |
+
|
187 |
+
chart = alt.Chart(df).mark_line().encode(
|
188 |
+
x='work_year:N',
|
189 |
+
y='salary:Q',
|
190 |
+
color='categoria:N'
|
191 |
+
).properties(
|
192 |
+
width=700,
|
193 |
+
height=400
|
194 |
+
)
|
195 |
+
|
196 |
+
st.altair_chart(chart, use_container_width=True)
|
197 |
+
|
198 |
+
st.title('Ejemplo de gráfico de dispersión')
|
199 |
+
|
200 |
+
chart = alt.Chart(df).mark_point().encode(
|
201 |
+
x='work_year:Q',
|
202 |
+
y='salary:Q',
|
203 |
+
color='genero:N'
|
204 |
+
).properties(
|
205 |
+
width=700,
|
206 |
+
height=400
|
207 |
+
)
|
208 |
+
|
209 |
+
st.altair_chart(chart, use_container_width=True)
|
210 |
+
|
211 |
+
st.title('Ejemplo de gráfico de pastel')
|
212 |
+
|
213 |
+
fig = px.pie(df, values='work_year', names='salary')
|
214 |
+
|
215 |
+
st.plotly_chart(fig, use_container_width=True)
|
216 |
|
217 |
st.markdown('''
|
218 |
<br>
|
|
|
239 |
|
240 |
st.image(dashboard_ejemplo, width=700)
|
241 |
|
|
|
242 |
st.markdown('''
|
243 |
<br>
|
244 |
<h3>Predicción de nuevos puestos de trabajo con ML</h3>
|
|
|
248 |
# st.set_page_config(page_title="Predicción de nuevos puestos de trabajo",
|
249 |
# page_icon=":bar_chart:", layout="wide")
|
250 |
|
|
|
|
|
251 |
# Cargar los datos
|
|
|
|
|
252 |
|
253 |
# Seleccionar las columnas relevantes
|
254 |
df_relevant = df[['job_title', 'work_year']]
|
|
|
386 |
#
|
387 |
if selected2 == "New":
|
388 |
|
|
|
389 |
progress_text = "Operation in progress. Please wait."
|
390 |
my_bar = st.progress(0, text=progress_text)
|
391 |
|