#Filtro:
opcoes_cidade = 'Cuiabá'
mostrar_graficos_em_png = True
import pandas as pd
import numpy as np
import glob
import os
import plotly.express as px
import plotly.graph_objects as go
import plotly.figure_factory as ff
import geopy
from geopy.geocoders import Nominatim
from IPython.display import clear_output, Image, Markdown as md
# caso true, gera os gráficos em formato png
try: mostrar_graficos_em_png
except NameError: mostrar_graficos_em_png = False
# Carrega arquivo .feather GEO
geo_polos = pd.read_feather('./dados/geo_polos.feather')
geo_polos = geo_polos.drop(columns=['index'])
# Carrega arquivo .feather MENSALIDADES
polos_mensalidades = pd.read_feather('./dados/mensalidades_polos.feather')
polos_mensalidades = polos_mensalidades.drop(columns=['index'])
# funcção para adicionar casas decimais
def real(valor):
a = "{:,.0f}".format(float(valor))
b = a.replace(',','v')
c = b.replace('.',',')
return c.replace('v','.')
#Lista de Cidades
lista_cidades = ['ALTAMIRA','AMERICANA','ANÁPOLIS','ARAQUARI','BELO HORIZONTE','BELÉM','BENEVIDES','BRASÍLIA''CAMPINAS','CAMPO GRANDE''CARAGUATATUBA''CARUARU','CASCAVEL''CODÓ','COLATINA','CUIABÁ','CURITIBA','DIADEMA','DUQUE DE CAXIAS','ENGENHEIRO COELHO''FLORIANÓPOLIS','FORTALEZA','GOIÂNIA''GRAVATAÍ','GUARULHOS','HORTOLÂNDIA','IMPERATRIZ','ITABORAÍ''ITARARÉ','JACAREÍ','JI-PARANÁ''JOINVILLE','JUIZ DE FORA','JUNDIAÍ','LAVRAS''LIMEIRA','MACAPÁ','MACEIÓ','MANAUS','MARABÁ','MOGI GUAÇU','OSASCO''PALMAS''PARAUAPEBAS','PAULÍNIA','PORTO VELHO','PRESIDENTE PRUDENTE','RECIFE','REGISTRO','RIO BRANCO''RIO CLARO','RIO DE JANEIRO','SAIRÉ','SALVADOR''SANTARÉM','SANTOS','SOROCABA''SÃO JOSÉ DO RIO PRETO','SÃO JOSÉ DOS CAMPOS''SÃO JOSÉ DOS PINHAIS''SÃO LUÍS','SÃO PAULO','TATUÍ','TELÊMACO BORBA''UBERABA','UBERLÂNDIA','URUARÁ''VITÓRIA DA CONQUISTA','VITÓRIA',]
lista_cidades.sort()
demanda = geo_polos[geo_polos.cidade == opcoes_cidade]
demanda = demanda[['pop-renda-a-partir-1/2salario', 'pop-renda-a-partir-1/2salario-18a44anos', 'pessoas-medio-completo-superior-incompleto-18a44anos', 'frequentando-graduacao-18a44anos', 'mercado']].copy()
pop_com_renda = demanda['pop-renda-a-partir-1/2salario'].iloc[0]
pop_com_renda_e_idade_univ = demanda['pop-renda-a-partir-1/2salario-18a44anos'].iloc[0]
pop_com_ensino_medio = demanda['pessoas-medio-completo-superior-incompleto-18a44anos'].iloc[0]
alu_ensino_sup = demanda['frequentando-graduacao-18a44anos'].iloc[0]
mercado = demanda['mercado'].iloc[0]
# adiciona casas decimais
pop_com_renda = float(pop_com_renda)
pop_com_renda = real(pop_com_renda)
pop_com_renda_e_idade_univ = float(pop_com_renda_e_idade_univ)
pop_com_renda_e_idade_univ = real(pop_com_renda_e_idade_univ)
pop_com_ensino_medio = float(pop_com_ensino_medio)
pop_com_ensino_medio = real(pop_com_ensino_medio)
alu_ensino_sup = float(alu_ensino_sup)
alu_ensino_sup = real(alu_ensino_sup)
mercado = float(mercado)
mercado = real(mercado)
# md("### População com renda: {} <br> (população com renda a partir de 1/2 salário mínimo.)<br><br> População com renda e idade universitária: {} <br> (Pessoas de 18 até 44 anos e com renda a partir e 1/2 salário mínimo)<br><br> População com ensino médio: {} <br> (Pessoas de 18 até 44 anos com ensino médio completo ou superior incompleto) <br><br> Cursando ensino superior: {} <br> (Alunos do ensino superior de 18 até 44 anos que residem na região) <br><br> Mercado potencial: {} <br> (Pessoas de 18 até 44 anos, com médio completo que não estão cursando o ensino superior)".format(pop_com_renda, pop_com_renda_e_idade_univ, pop_com_ensino_medio, alu_ensino_sup, mercado))
# percentual da população ente 18 e 44 anos
geo_polos['percentual_18a24'] = round(geo_polos['idade-18a24'] * 100 / geo_polos['populacao'])
# percentual da população homem
geo_polos['percentual_m'] = round(geo_polos['pop-masculino'] * 100 / geo_polos['populacao'])
# percentual da população mulher
geo_polos['percentual_f'] = round(geo_polos['pop-feminino'] * 100 / geo_polos['populacao'])
pop = geo_polos['populacao'].iloc[0]
pop_m = geo_polos['pop-masculino'].iloc[0]
pop_f = geo_polos['pop-feminino'].iloc[0]
pop_perc_18a44 = geo_polos['percentual_18a24'].iloc[0]
pop_perc_m = geo_polos['percentual_m'].iloc[0]
pop_perc_f = geo_polos['percentual_f'].iloc[0]
# adiciona casas decimais
pop = float(pop)
pop = real(pop)
pop_m = float(pop_m)
pop_m = real(pop_m)
pop_f = float(pop_f)
pop_f = real(pop_f)
# md("## População total: {} <br><br>Homens: {} ({}%) <br> Mulheres: {} ({}%) <br><br> {}% com idade entre 18 e 44 anos".format(pop, pop_m, pop_perc_m, pop_f, pop_perc_f, pop_perc_18a44))
lista_a = list()
lista_a.append("População total:")
lista_a.append("Homens:")
lista_a.append("Mulheres:")
lista_a.append("População com renda:")
lista_a.append("População com renda e idade universitária:")
lista_a.append("População com ensino médio:")
lista_a.append("Cursando ensino superior:")
lista_a.append("Mercado potencial:")
lista_b = list()
lista_b.append("{}".format(pop))
lista_b.append("{} ({}%)".format(pop_m, pop_perc_m))
lista_b.append("{} ({}%)".format(pop_f, pop_perc_f))
lista_b.append("{}".format(pop_com_renda))
lista_b.append("{}".format(pop_com_renda_e_idade_univ))
lista_b.append("{}".format(pop_com_ensino_medio))
lista_b.append("{}".format(alu_ensino_sup))
lista_b.append("{}".format(mercado))
lista_c = list()
lista_c.append("{}% com idade entre 18 e 44 anos".format(pop_perc_18a44))
lista_c.append(" - ")
lista_c.append(" - ")
lista_c.append("população com renda a partir de 1/2 salário mínimo")
lista_c.append("pessoas de 18 até 44 anos e com renda a partir e 1/2 salário mínimo")
lista_c.append("pessoas de 18 até 44 anos com ensino médio completo ou superior incompleto")
lista_c.append("alunos do ensino superior de 18 até 44 anos que residem na região")
lista_c.append("pessoas de 18 até 44 anos, com médio completo que não estão cursando o ensino superior")
df = pd.DataFrame(list(zip(lista_a,lista_b,lista_c)),columns=['Indicador','Valor','Obs'])
fig = go.Figure(data=[go.Table(
columnwidth = [50,35,100],
header=dict(
fill_color='#6BAED6',
align='left',
height=0),
cells=dict(values=[df.Indicador,df.Valor,df.Obs],
fill_color='lavender',
align=['left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[15,15,15],
height=60))
])
fig.add_annotation(
xref='x domain', yref='y2 domain', x=1.0, y=1, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1200, height=700, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
renda = geo_polos[['cidade', '1-salario', '1ate2-salarios', '2ate5-salarios', '5ate10-salarios', '10ate20-salarios', '20-salarios']].copy()
# rename colunas
renda.rename(columns={'1-salario':'Mais de 1/2 até 1 salário mínimo',
'1ate2-salarios':'Mais de 1 até 2 salários mínimos',
'2ate5-salarios':'Mais de 2 até 5 salários mínimos',
'5ate10-salarios':'Mais de 5 até 10 salários mínimos',
'10ate20-salarios':'Mais de 10 até 20 salários mínimos',
'20-salarios':'Mais de 20 salários mínimos'
},inplace=True)
# transpor colunas em linhas
renda1= renda.set_index('cidade').stack().reset_index(name='value')
fig = px.bar(renda1,
y= 'value',
x= 'level_1',
text= 'value',
title= 'Distribuição de Renda da população - ' + opcoes_cidade,
color='level_1',
color_discrete_sequence=px.colors.sequential.Blues_r,
labels={
'value':'População',
'level_1':'Classe social'
}, height=600
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=-0.5, text='Fonte: IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
fig.update_traces(texttemplate='%{text:.2s}', textposition='outside')
fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
# percentual da população matriculados
geo_polos['percentual_matriculados'] = round(geo_polos['Matriculados'] * 100 / geo_polos['populacao'])
educacao = geo_polos[['cidade', 'Matriculados', 'Concluintes', 'Ingressantes']].copy()
# transpor colunas em linhas
educacao = educacao.set_index('cidade').stack().reset_index(name='value')
matri = geo_polos['Matriculados'].iloc[0]
# adiciona casas decimais
matri = float(matri)
matri = real(matri)
matri
fig = px.bar(educacao,
y='value',
x='level_1',
text='value',
title= (str(matri))+' alunos estão matriculados no ensino superior e o total representa aproximadamente '+ str(round(geo_polos['percentual_matriculados'].iloc[0],2))+'% da População de '+opcoes_cidade,
color='level_1',
color_discrete_sequence=px.colors.sequential.Blues_r,
labels={'level_1':'Alunos', 'value':'Quantidade'},
height=550
)
fig.add_annotation(xref='paper', yref='paper', x=1.0, y=-0.2, text='Fonte: INEP - Censo Educacional (2019)', showarrow=False, arrowhead=1)
fig.update_traces(texttemplate='%{text:.2s}', textposition='outside')
fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
modalidade = geo_polos[['cidade', 'matriculados-ead', 'matriculados-presencial',]].copy()
# rename colunas
modalidade.rename(columns={
'matriculados-ead':'EAD',
'matriculados-presencial':'Presencial',
},inplace=True)
# transpor colunas em linhas
modalidade = modalidade.set_index('cidade').stack().reset_index(name='value')
# total de matriculados do município
total_matriculados = geo_polos['matriculados-ead'].iloc[0] + geo_polos['matriculados-ead'].iloc[0]
# adiciona casas decimais
total_matriculados = float(total_matriculados)
total_matriculados = real(total_matriculados)
fig = px.pie(modalidade,
values='value',
names='level_1',
title=' Total de '+ str(total_matriculados) + ' alunos matriculados no município de ' +str(opcoes_cidade),
color='level_1',
# color_discrete_map={'EAD':'#6cbcff',
# 'Presencial':'#a0a7d6'},
color_discrete_sequence=px.colors.sequential.Blues_r,
labels={'level_1':'Modalidade','value':'Alunos Matriculados'}
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=0, text='Fonte: INEP - Censo Educacional (2019)',
showarrow=False, arrowhead=1
)
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
idade = geo_polos[['cidade', 'alunos-idade-65+','alunos-idade-60a64','alunos-idade-55a59','alunos-idade-50a54','alunos-idade-45a49','alunos-idade-40a44','alunos-idade-35a39','alunos-idade-30a34','alunos-idade-25a29','alunos-idade-19a24','alunos-idade-18-',]].copy()
# rename colunas''' '''
idade.rename(columns={
'alunos-idade-18-':'18 anos ou menos',
'alunos-idade-19a24':'de 19 até 24',
'alunos-idade-25a29':'de 25 até 29',
'alunos-idade-30a34':'de 30 até 34',
'alunos-idade-35a39':'de 35 até 39',
'alunos-idade-40a44':'de 40 até 44',
'alunos-idade-45a49':'de 45 até 49',
'alunos-idade-50a54':'de 50 até 54',
'alunos-idade-55a59':'de 55 até 59',
'alunos-idade-60a64':'de 60 até 64',
'alunos-idade-65+':'65 anos ou mais'
},inplace=True)
# transpor colunas em linhas
idade = idade.set_index('cidade').stack().reset_index(name='value')
idade
fig = px.bar(idade,
title=' Distribuição de alunos matriculados por idade - '+str(opcoes_cidade),
x='value',
y='level_1',
text='value',
# title= (str(geo_polos['Matriculados'].iloc[0]))+' alunos estão matriculados no ensino superior e o total representa aproximadamente '+ str(round(geo_polos['percentual_matriculados'].iloc[0],2))+'% da População.',
labels={'level_1':'Perfil', 'value':'Alunos'},
color_discrete_sequence=px.colors.sequential.Blues_r,
category_orders={"level_1": ['18 anos ou menos','de 19 até 24','de 25 até 29','de 30 até 34','de 35 até 39','de 40 até 44','de 45 até 49','de 50 até 54','de 55 até 59','de 60 até 64','65 anos ou mais']},
height=550
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=-0.2, text='Fonte: INEP - Censo Educacional (2019)',
showarrow=False, arrowhead=1
)
fig.update_traces(texttemplate='%{text:.2s}', textposition='outside')
fig.update_layout(uniformtext_minsize=8, uniformtext_mode='hide')
fig.update_xaxes(categoryorder='total descending')
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
sexo = geo_polos[['cidade', 'total-alunos-masculino', 'total-alunos-feminino']].copy()
# rename colunas
sexo.rename(columns={
'total-alunos-masculino':'Masculino',
'total-alunos-feminino':'Feminino'
},inplace=True)
# transpor colunas em linhas
sexo = sexo.set_index('cidade').stack().reset_index(name='value')
# total de matriculados do município
total_sexo = geo_polos['total-alunos-masculino'].iloc[0] + geo_polos['total-alunos-feminino'].iloc[0]
# adiciona casas decimais
total_sexo = float(total_sexo)
total_sexo = real(total_sexo)
fig = px.pie(sexo,
values='value',
names='level_1',
title='Alunos no município de ' +str(opcoes_cidade),
color='level_1',
color_discrete_sequence=px.colors.sequential.Blues_r,
labels={'level_1':'Sexo','value':'Total de Alunos '}
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=-0.2, text='Fonte: INEP - Censo Educacional (2019)',
showarrow=False, arrowhead=1
)
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
#carrega matriculas e filtra polos
matriculas = pd.read_csv('./dados/matriculas_municipio.csv',sep=';')
cidades = matriculas[['city_id','city_name','state_sigle']].drop_duplicates()
polos = ['CASCAVEL','SÃO JOSÉ DOS PINHAIS','TELÊMACO BORBA','PORTO VELHO','JI-PARANÁ','BRASÍLIA','MACAPÁ','CAMPO GRANDE','BELO HORIZONTE','JUIZ DE FORA','UBERABA','UBERLÂNDIA','LAVRAS','ALTAMIRA','BELÉM','BENEVIDES','MARABÁ','PARAUAPEBAS','SANTARÉM','URUARÁ','IMPERATRIZ','SÃO LUÍS','CODÓ','RIO DE JANEIRO','ITABORAÍ','DUQUE DE CAXIAS','MANAUS','JACAREÍ','HORTOLÂNDIA','ENGENHEIRO COELHO','RECIFE','CARUARU','SAIRÉ','CUIABÁ','SÃO PAULO','SÃO JOSÉ DOS CAMPOS','REGISTRO','CAMPINAS','JUNDIAÍ','AMERICANA','RIO CLARO','SOROCABA','ITARARÉ','FLORIANÓPOLIS','JOINVILLE','ARAQUARI','FORTALEZA','GOIÂNIA','ANÁPOLIS','SANTOS','SÃO JOSÉ DO RIO PRETO','DIADEMA','RIO BRANCO','MACEIÓ','PRESIDENTE PRUDENTE','TATUÍ','VITÓRIA','COLATINA','SALVADOR','VITÓRIA DA CONQUISTA','LIMEIRA','MOGI GUAÇU','PAULÍNIA','PALMAS','GRAVATAÍ','GUARULHOS','OSASCO','CARAGUATATUBA']
polos.sort()
cidades2 = cidades[(cidades.city_name.isin(polos))].copy()
cidades2.sort_values(by='city_name',inplace=True)
cidades_excluir = [2501906,2303501] #Cidades duplicadas
cidades3 = cidades2[(~cidades2.city_id.isin(cidades_excluir))]
#seleciona registros por cidade
cidade = str.lower(opcoes_cidade)
matriculas = matriculas[(matriculas.city_name.str.lower() == cidade)]
matriculas.rename(columns={'fact_student_aggregated_entrance_total_2019':'entrance','fact_student_aggregated_matriculation_total_2019':'enrollment'},inplace=True)
#total de matriculas
matriculas_ead = matriculas[(matriculas.course_modality == 1)]
matriculas_total = matriculas.groupby('ies_sigle').agg(entrance=('entrance','sum'),enrollment=('enrollment','sum'))
matriculas_total.reset_index(inplace=True)
matriculas_total.sort_values(by='enrollment',inplace=True,ascending=False)
matriculas_total['percent'] = (matriculas_total['enrollment'] / matriculas_total['enrollment'].sum()) * 100
matriculas_total['cum_sum'] = matriculas_total["enrollment"].cumsum()
matriculas_total['cum_perc'] = round(100*matriculas_total.cum_sum/matriculas_total["enrollment"].sum(),2)
matriculas_total_outros = matriculas_total[(matriculas_total.cum_perc > 80)].copy()
qtd_outros = len(matriculas_total_outros.index)
matriculas_total_outros['ies_sigle'] = 'OUTROS: ' + str(qtd_outros) + ' IES'
matriculas_total_outros = matriculas_total_outros.groupby('ies_sigle').agg(entrance=('entrance','sum'),enrollment=('enrollment','sum')).reset_index()
matriculas_total_ies = matriculas_total[(matriculas_total.cum_perc <= 80)]
matriculas_total_ies = matriculas_total_ies[['ies_sigle','entrance','enrollment']]
matriculas_total = pd.concat([matriculas_total_ies,matriculas_total_outros])
#matriculas ead
matriculas_ead = matriculas[(matriculas.course_modality == 2)]
matriculas_ead = matriculas_ead.groupby('ies_sigle').agg(entrance=('entrance','sum'),enrollment=('enrollment','sum'))
matriculas_ead.reset_index(inplace=True)
matriculas_ead.sort_values(by='enrollment',inplace=True,ascending=False)
matriculas_ead['percent'] = (matriculas_ead['enrollment'] / matriculas_ead['enrollment'].sum()) * 100
matriculas_ead['cum_sum'] = matriculas_ead["enrollment"].cumsum()
matriculas_ead['cum_perc'] = round(100*matriculas_ead.cum_sum/matriculas_ead["enrollment"].sum(),2)
matriculas_ead_outros = matriculas_ead[(matriculas_ead.cum_perc > 80)].copy()
qtd_outros = len(matriculas_ead_outros.index)
matriculas_ead_outros['ies_sigle'] = 'OUTROS: ' + str(qtd_outros) + ' IES'
matriculas_ead_outros = matriculas_ead_outros.groupby('ies_sigle').agg(entrance=('entrance','sum'),enrollment=('enrollment','sum')).reset_index()
matriculas_ead_ies = matriculas_ead[(matriculas_ead.cum_perc <= 80)]
matriculas_ead_ies = matriculas_ead_ies[['ies_sigle','entrance','enrollment']]
matriculas_ead = pd.concat([matriculas_ead_ies,matriculas_ead_outros])
#Share de alunos - EAD
fig = px.pie(matriculas_ead,
title='Share de matrículas EAD por IES - ' + opcoes_cidade,
values='enrollment',
names='ies_sigle',
# title=' Total de '+ str(total_sexo) + ' alunos no município de ' +str(opcoes_cidade),
color='ies_sigle',
color_discrete_sequence=px.colors.sequential.Blues_r,
labels={'enrollement':'Matriculados','ies_sigle':'IES'}
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=-0.2, text='Fonte: INEP - Censo Educacional (2019)',
showarrow=False, arrowhead=1
)
fig.update_traces(textposition='inside', textinfo='percent+label')
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
#Share de alunos - total
fig = px.pie(matriculas_total,
title='Share de matrículas Presenciais por IES - ' + opcoes_cidade,
values='enrollment',
names='ies_sigle',
# title=' Total de '+ str(total_sexo) + ' alunos no município de ' +str(opcoes_cidade),
color='ies_sigle',
color_discrete_sequence=px.colors.sequential.Blues_r,
labels={'enrollement':'Matriculados','ies_sigle':'IES'}
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=-0.2, text='Fonte: INEP - Censo Educacional (2019)',
showarrow=False, arrowhead=1
)
fig.update_traces(textposition='inside', textinfo='percent+label')
if(mostrar_graficos_em_png):
grafico_png = fig.to_image(format="png", width=1000, height=550, engine="kaleido")
display(Image(grafico_png))
del grafico_png
else:
fig.show()
# Carrega arquivo do polo
mensalidades = polos_mensalidades[polos_mensalidades.cidade == opcoes_cidade]
mensalidades_agg = mensalidades.groupby(['ies','curso','modalidade']).agg(preco_cheio=('preco_cheio','mean'),preco_desconto=('preco_desconto','mean')).reset_index()
mensalidades_agg['preco_cheio'] = round(mensalidades_agg['preco_cheio'],2)
mensalidades_agg['preco_desconto'] = round(mensalidades_agg['preco_desconto'],2)
modalidades = mensalidades_agg.groupby(['modalidade']).agg(qtd_ofertas=('curso','count'),preco_cheio=('preco_cheio','mean'),preco_desconto=('preco_desconto','mean'))
modalidades['preco_cheio'] = round(modalidades['preco_cheio'],2)
modalidades['preco_desconto'] = round(modalidades['preco_desconto'],2)
df = modalidades.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_cheio'] = df['preco_cheio'].apply(format)
df['preco_desconto'] = df['preco_desconto'].apply(format)
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
header=dict(values=['Modalidade','Ofertas','Preço Tabela','Preço com Desconto'],
height=40,
fill_color='#6BAED6',
align='left'),
cells=dict(values=[df.modalidade,df.qtd_ofertas,df.preco_cheio,df.preco_desconto],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=60))
])
fig.add_annotation(
xref='x domain', yref='y2 domain', x=1.0, y=-1, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| modalidade | qtd_ofertas | preco_cheio | preco_desconto |
|:-------------|--------------:|:--------------|:-----------------|
| EAD | 1498 | R$355.09 | R$251.20 |
| Presencial | 136 | R$1051.82 | R$669.79 |
vcfr5vvvvvvvvfig = px.box(mensalidades_agg,
x="modalidade", y='preco_cheio', color='modalidade',
points='all',
hover_data=['ies', 'modalidade', 'preco_desconto', 'preco_cheio'],
# title='Figura 47 - Mensalidades Curso de Biomedicina | Valor tabela | Região: Estado de São Paulo',
labels={
'preco_cheio': 'Valor da Mensalidade',
'preco_desconto': 'Valor da Mensalidade com desconto',
'modalidade': 'Modalidade do Curso',
'ies': 'IES'
}
)
fig.add_annotation(
xref='paper', yref='paper', x=1.0, y=-0.2, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
mensalidades_ies = mensalidades_agg[mensalidades_agg.modalidade == 'EAD']
mensalidades_ies = mensalidades_ies.groupby(['ies','modalidade']).agg(qtd_ofertas=('curso','count'),
preco_cheio_medio=('preco_cheio','mean'),
preco_desconto_medio=('preco_desconto','mean')).reset_index()
mensalidades_ies.sort_values(by='ies',ascending=True,inplace=True)
mensalidades_ies['preco_cheio_medio'] = round(mensalidades_ies['preco_cheio_medio'],2)
mensalidades_ies['preco_desconto_medio'] = round(mensalidades_ies['preco_desconto_medio'],2)
df = mensalidades_ies.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_cheio_medio'] = df['preco_cheio_medio'].apply(format)
df['preco_desconto_medio'] = df['preco_desconto_medio'].apply(format)
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
header=dict(values=['IES','Modalidade','Preço Tabela','Preço com Desconto'],
height=40,
fill_color='#6BAED6',
align='left'),
cells=dict(values=[df.ies,df.modalidade,df.preco_cheio_medio,df.preco_desconto_medio],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=30,
))
])
df.drop(columns=['index','qtd_ofertas'],inplace=True)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| ies | modalidade | preco_cheio_medio | preco_desconto_medio |
|:----------------|:-------------|:--------------------|:-----------------------|
| ANHANGUERA | EAD | R$398.67 | R$195.01 |
| CLARETIANO | EAD | R$359.20 | R$322.45 |
| CRUZEIRO DO SUL | EAD | R$284.87 | R$284.87 |
| EDUCAMAIS | EAD | R$210.33 | R$210.33 |
| ENIAC | EAD | R$307.22 | R$289.31 |
| ESTÁCIO | EAD | R$444.12 | R$225.52 |
| FAEL | EAD | R$257.45 | R$177.51 |
| FAG | EAD | R$273.37 | R$246.53 |
| FAJ | EAD | R$249.00 | R$224.10 |
| FAM | EAD | R$214.30 | R$214.30 |
| FATECNA | EAD | R$179.00 | R$179.00 |
| FCE | EAD | R$175.18 | R$175.18 |
| FCV | EAD | R$272.55 | R$272.55 |
| FDPII | EAD | R$330.00 | R$198.00 |
| FMU | EAD | R$497.81 | R$282.46 |
| FSB | EAD | R$211.75 | R$196.12 |
| IAVM | EAD | R$135.55 | R$135.55 |
| IBTA | EAD | R$248.56 | R$238.49 |
| INFNET | EAD | R$774.63 | R$449.28 |
| INTA | EAD | R$526.45 | R$210.58 |
| MACKENZIE | EAD | R$438.00 | R$394.20 |
| SENAC | EAD | R$311.48 | R$303.42 |
| SÃO LUÍS | EAD | R$127.12 | R$127.12 |
| UAM | EAD | R$521.07 | R$260.54 |
| UCAM | EAD | R$158.42 | R$158.42 |
| UCDB | EAD | R$306.81 | R$267.79 |
| UNAR | EAD | R$169.00 | R$169.00 |
| UNASP | EAD | R$278.33 | R$278.33 |
| UNIANDRADE | EAD | R$227.72 | R$227.72 |
| UNIARAXÁ | EAD | R$280.20 | R$280.20 |
| UNIASSELVI | EAD | R$328.25 | R$273.11 |
| UNIC | EAD | R$850.15 | R$378.77 |
| UNICSUL | EAD | R$394.17 | R$205.97 |
| UNIFAVIP | EAD | R$182.21 | R$182.21 |
| UNIFAVIP WYDEN | EAD | R$140.52 | R$140.52 |
| UNIGRAN | EAD | R$258.97 | R$258.97 |
| UNILINS | EAD | R$153.54 | R$153.54 |
| UNIMES | EAD | R$316.50 | R$316.50 |
| UNINABUCO | EAD | R$164.34 | R$164.34 |
| UNINASSAU | EAD | R$532.63 | R$353.63 |
| UNINORTE | EAD | R$491.48 | R$441.37 |
| UNINTA | EAD | R$272.82 | R$244.00 |
| UNINTER | EAD | R$285.87 | R$239.42 |
| UNIP | EAD | R$172.96 | R$155.10 |
| UNIPLAN | EAD | R$3199.24 | R$917.06 |
| UNIS | EAD | R$230.00 | R$230.00 |
| UNISA | EAD | R$177.74 | R$177.74 |
| UNISUL | EAD | R$538.99 | R$326.30 |
| UNIVAG | EAD | R$860.00 | R$430.00 |
| UNIVERITAS | EAD | R$460.44 | R$234.48 |
| UNIVERSO | EAD | R$266.81 | R$266.81 |
| UNOESTE | EAD | R$375.62 | R$353.21 |
| UNOPAR | EAD | R$385.26 | R$181.04 |
| UNYLEYA | EAD | R$338.00 | R$196.04 |
mensalidades_ies = mensalidades_agg[mensalidades_agg.modalidade == 'Presencial']
mensalidades_ies = mensalidades_ies.groupby(['ies','modalidade']).agg(qtd_ofertas=('curso','count'),
preco_cheio_medio=('preco_cheio','mean'),
preco_desconto_medio=('preco_desconto','mean')).reset_index()
mensalidades_ies.sort_values(by='ies',ascending=True,inplace=True)
mensalidades_ies['preco_cheio_medio'] = round(mensalidades_ies['preco_cheio_medio'],2)
mensalidades_ies['preco_desconto_medio'] = round(mensalidades_ies['preco_desconto_medio'],2)
# mensalidades_ies = mensalidades_ies[[]]
df = mensalidades_ies.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_cheio_medio'] = df['preco_cheio_medio'].apply(format)
df['preco_desconto_medio'] = df['preco_desconto_medio'].apply(format)
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
header=dict(values=['IES','Modalidade','Preço Tabela','Preço com Desconto'],
height=40,
fill_color='#6BAED6',
align='left'),
cells=dict(values=[df.ies,df.modalidade,df.preco_cheio_medio,df.preco_desconto_medio],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=30,
))
])
df.drop(columns=['index','qtd_ofertas'],inplace=True)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| ies | modalidade | preco_cheio_medio | preco_desconto_medio |
|:-----------|:-------------|:--------------------|:-----------------------|
| AUM | Presencial | R$1618.34 | R$580.28 |
| BRAZ CUBAS | Presencial | R$1049.22 | R$748.55 |
| EDUCARE | Presencial | R$532.08 | R$532.08 |
| ESTÁCIO | Presencial | R$629.04 | R$293.39 |
| FAIPE | Presencial | R$733.16 | R$512.41 |
| FAMAT | Presencial | R$441.87 | R$419.00 |
| FAUC | Presencial | R$1017.96 | R$561.24 |
| FCE | Presencial | R$199.00 | R$199.00 |
| FCR | Presencial | R$1496.52 | R$647.75 |
| FFC | Presencial | R$1999.17 | R$848.72 |
| FP | Presencial | R$427.20 | R$277.50 |
| ICE | Presencial | R$346.37 | R$337.28 |
| ICEC | Presencial | R$1270.24 | R$704.08 |
| IESMT | Presencial | R$1403.40 | R$902.76 |
| SENAI | Presencial | R$404.10 | R$379.13 |
| UNIASSELVI | Presencial | R$749.39 | R$562.78 |
| UNIC | Presencial | R$6932.00 | R$5432.00 |
| UNIVERITAS | Presencial | R$860.86 | R$430.44 |
mensalidades_curso = mensalidades_agg[mensalidades_agg.modalidade == 'EAD']
mensalidades_curso = mensalidades_curso.groupby(['curso']).agg(qtd_ofertas=('curso','count'), preco_medio=('preco_cheio','mean'), menor_preco=('preco_cheio','min'), maior_preco=('preco_cheio','max'), desvio_padrao=('preco_cheio', np.std)).reset_index()
mensalidades_curso['preco_medio'] = round(mensalidades_curso['preco_medio'],2)
mensalidades_curso['menor_preco'] = round(mensalidades_curso['menor_preco'],2)
mensalidades_curso['maior_preco'] = round(mensalidades_curso['maior_preco'],2)
mensalidades_curso['desvio_padrao'] = round(mensalidades_curso['desvio_padrao'],2)
mensalidades_curso = mensalidades_curso.fillna(0)
df = mensalidades_curso.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_medio'] = df['preco_medio'].apply(format)
df['menor_preco'] = df['menor_preco'].apply(format)
df['maior_preco'] = df['maior_preco'].apply(format)
df['desvio_padrao'] = df['desvio_padrao'].apply(format)
df = df[['curso','qtd_ofertas','menor_preco','maior_preco']].copy()
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
# header=dict(values=['Curso', 'Ofertas', 'Preço Médio','Menor Preço','Maior Preço','DP'],
header=dict(values=['Curso', 'Ofertas', 'Menor Preço','Maior Preço'],
height=40,
fill_color='#6BAED6',
align='left'),
# cells=dict(values=[df.curso,df.qtd_ofertas,df.preco_medio,df.menor_preco,df.maior_preco,df.desvio_padrao],
cells=dict(values=[df.curso,df.qtd_ofertas,df.menor_preco,df.maior_preco],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=60))
])
fig.add_annotation(
xref='x domain', yref='y2 domain', x=1.0, y=-1, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| curso | qtd_ofertas | menor_preco | maior_preco |
|:-------------------------------------------------|--------------:|:--------------|:--------------|
| ADMINISTRAÇÃO | 45 | R$99.00 | R$677.93 |
| ADMINISTRAÇÃO PÚBLICA | 4 | R$224.00 | R$431.82 |
| AGRONEGÓCIOS E AGRICULTURA | 12 | R$139.33 | R$919.00 |
| AGRONOMIA | 1 | R$249.90 | R$249.90 |
| ALIMENTOS | 1 | R$305.00 | R$305.00 |
| ANÁLISE DE DADOS | 1 | R$335.33 | R$335.33 |
| ANÁLISE E DESENVOLVIMENTO DE SISTEMAS | 30 | R$126.58 | R$644.36 |
| ARQUITETURA E URBANISMO | 6 | R$154.95 | R$1469.74 |
| ARQUIVOLOGIA E BIBLIOTECONOMIA | 1 | R$318.37 | R$318.37 |
| ARTES | 1 | R$149.90 | R$149.90 |
| ARTES PLÁSTICAS E VISUAIS | 14 | R$113.83 | R$465.00 |
| ARTES VISUAIS | 3 | R$199.99 | R$463.33 |
| ASSESSORIA EXECUTIVA DIGITAL | 1 | R$273.14 | R$273.14 |
| BANCO DE DADOS | 6 | R$129.00 | R$758.07 |
| BIBLIOTECONOMIA | 3 | R$275.00 | R$439.42 |
| BIG DATA | 2 | R$256.47 | R$430.00 |
| BIG DATA E INTELIGÊNCIA ANALÍTICA | 2 | R$272.55 | R$427.14 |
| BIOLOGIA | 16 | R$149.90 | R$465.00 |
| BIOMEDICINA | 8 | R$269.90 | R$1296.10 |
| CIÊNCIA DA COMPUTAÇÃO | 8 | R$159.90 | R$1426.79 |
| CIÊNCIA DE DADOS | 3 | R$269.90 | R$632.37 |
| CIÊNCIAS AERONÁUTICAS | 6 | R$229.90 | R$1346.43 |
| CIÊNCIAS BIOLÓGICAS | 3 | R$259.90 | R$274.42 |
| CIÊNCIAS CONTÁBEIS | 42 | R$99.00 | R$671.47 |
| CIÊNCIAS DA NATUREZA | 1 | R$392.92 | R$392.92 |
| CIÊNCIAS DA RELIGIÃO | 5 | R$191.85 | R$342.71 |
| CIÊNCIAS ECONÔMICAS | 24 | R$149.00 | R$700.00 |
| CIÊNCIAS ECONÔMICAS E DE INVESTIMENTOS | 1 | R$302.00 | R$302.00 |
| CIÊNCIAS EXATAS | 1 | R$383.83 | R$383.83 |
| CIÊNCIAS POLÍTICAS | 8 | R$169.90 | R$615.96 |
| CIÊNCIAS SOCIAIS | 6 | R$169.00 | R$465.00 |
| COACH DIGITAL | 3 | R$133.40 | R$518.86 |
| COACH E MENTORING | 3 | R$133.40 | R$401.68 |
| COMUNICAÇÃO INSTITUCIONAL | 3 | R$239.04 | R$392.17 |
| COMUNICAÇÃO SOCIAL | 6 | R$432.99 | R$1272.62 |
| COMUNICAÇÃO SOCIAL - PUBLICIDADE E PROPAGANDA | 1 | R$413.37 | R$413.37 |
| COMUNICAÇÃO SOCIAL - JORNALISMO | 2 | R$333.84 | R$359.40 |
| COMUNICAÇÃO SOCIAL - MÍDIAS DIGITAIS | 1 | R$273.14 | R$273.14 |
| COMUNICAÇÃO SOCIAL - PRODUÇÃO EDITORIAL | 7 | R$318.37 | R$1065.33 |
| COMUNICAÇÃO SOCIAL - PRODUÇÃO MULTIMÍDIA | 3 | R$318.37 | R$466.64 |
| COMUNICAÇÃO SOCIAL - PUBLICIDADE E PROPAGANDA | 2 | R$351.50 | R$359.40 |
| COMÉRCIO EXTERIOR | 19 | R$129.00 | R$467.69 |
| CONSTRUÇÃO DE EDIFÍCIOS | 1 | R$480.84 | R$480.84 |
| DATA SCIENCE | 6 | R$129.00 | R$393.96 |
| DEFESA CIBERNÉTICA | 2 | R$268.48 | R$272.89 |
| DESIGN | 1 | R$514.14 | R$514.14 |
| DESIGN DE ANIMAÇÃO | 4 | R$266.00 | R$663.33 |
| DESIGN DE INTERIORES | 16 | R$133.40 | R$919.00 |
| DESIGN DE MODA | 5 | R$318.40 | R$462.00 |
| DESIGN DE PRODUTO | 5 | R$256.47 | R$498.33 |
| DESIGN GRÁFICO | 6 | R$268.12 | R$663.33 |
| DIREITO | 1 | R$1605.36 | R$1605.36 |
| ECONOMIA DOMÉSTICA | 4 | R$275.00 | R$426.87 |
| EDUCAÇÃO ESPECIAL | 12 | R$149.90 | R$424.07 |
| EDUCAÇÃO FISICA | 2 | R$149.90 | R$329.90 |
| EDUCAÇÃO FÍSICA | 22 | R$199.99 | R$791.98 |
| EDUCAÇÃO FÍSICA (GRADUAÇÃO PLENA) | 1 | R$134.50 | R$134.50 |
| EMBELEZAMENTO E IMAGEM PESSOAL | 1 | R$458.58 | R$458.58 |
| EMPREENDEDORISMO | 7 | R$104.00 | R$360.59 |
| ENFERMAGEM | 5 | R$299.40 | R$1208.26 |
| ENGENHARIA AMBIENTAL | 6 | R$159.00 | R$1605.36 |
| ENGENHARIA AMBIENTAL E SANITÁRIA | 3 | R$304.50 | R$714.14 |
| ENGENHARIA CIVIL | 14 | R$165.00 | R$1467.91 |
| ENGENHARIA DA COMPUTAÇÃO | 5 | R$159.00 | R$1626.78 |
| ENGENHARIA DE COMPUTAÇÃO | 5 | R$459.90 | R$938.02 |
| ENGENHARIA DE CONTROLE E AUTOMAÇÃO | 3 | R$598.00 | R$748.33 |
| ENGENHARIA DE PRODUÇÃO | 21 | R$159.00 | R$1255.46 |
| ENGENHARIA DE SOFTWARE | 9 | R$174.00 | R$938.02 |
| ENGENHARIA ELÉTRICA | 15 | R$165.00 | R$1404.89 |
| ENGENHARIA MECATRÔNICA | 3 | R$159.00 | R$611.97 |
| ENGENHARIA MECÂNICA | 11 | R$165.00 | R$1425.00 |
| ENGENHARIA QUÍMICA | 1 | R$178.00 | R$178.00 |
| ENGENHARIA SANITÁRIA | 1 | R$278.85 | R$278.85 |
| ESPORTE E GESTÃO DESPORTIVA | 2 | R$239.90 | R$241.58 |
| ESTATÍSTICA | 2 | R$481.67 | R$596.67 |
| ESTETICA, COSMETICA, BELEZA E IMAGEM PESSOAL | 10 | R$149.90 | R$1030.03 |
| ESTÉTICA | 2 | R$159.00 | R$288.90 |
| EVENTOS | 5 | R$159.00 | R$581.67 |
| FARMÁCIA E BIOQUÍMICA | 9 | R$249.20 | R$919.00 |
| FILMMAKER | 3 | R$133.40 | R$518.86 |
| FILOSOFIA | 18 | R$135.08 | R$690.29 |
| FINANÇAS | 1 | R$273.14 | R$273.14 |
| FISIOTERAPIA | 9 | R$249.20 | R$1177.54 |
| FONOAUDIOLOGIA | 1 | R$3199.24 | R$3199.24 |
| FORMAÇÃO DE PROFESSORES | 2 | R$221.26 | R$259.90 |
| FOTOGRAFIA | 4 | R$249.90 | R$1069.64 |
| FÍSICA | 9 | R$134.20 | R$342.71 |
| GASTRONOMIA | 15 | R$159.00 | R$1400.00 |
| GEOGRAFIA | 20 | R$130.83 | R$465.00 |
| GEOPROCESSAMENTO | 1 | R$480.84 | R$480.84 |
| GERONTOLOGIA | 6 | R$160.65 | R$362.04 |
| GESTÃO AMBIENTAL | 32 | R$99.00 | R$684.60 |
| GESTÃO BANCÁRIA | 2 | R$271.60 | R$295.20 |
| GESTÃO COMERCIAL | 33 | R$106.70 | R$860.00 |
| GESTÃO DA PRODUÇÃO INDUSTRIAL | 1 | R$272.55 | R$272.55 |
| GESTÃO DA QUALIDADE | 21 | R$106.70 | R$448.33 |
| GESTÃO DA TECNOLOGIA DA INFORMAÇÃO | 17 | R$122.97 | R$664.81 |
| GESTÃO DA VIGILÂNCIA EM SAÚDE | 1 | R$247.86 | R$247.86 |
| GESTÃO DAS ORGANIZAÇÕES DO TERCEIRO SETOR | 2 | R$151.20 | R$249.90 |
| GESTÃO DE COOPERATIVAS | 2 | R$272.55 | R$293.22 |
| GESTÃO DE E-COMMERCE | 2 | R$216.18 | R$279.70 |
| GESTÃO DE EMERGÊNCIAS | 1 | R$277.78 | R$277.78 |
| GESTÃO DE PROCESSOS SECRETARIAIS E ESCOLARES | 1 | R$311.11 | R$311.11 |
| GESTÃO DE RECURSOS HUMANOS | 44 | R$106.70 | R$860.00 |
| GESTÃO DE SAÚDE | 1 | R$264.51 | R$264.51 |
| GESTÃO DE SERVIÇOS JURÍDICOS | 2 | R$301.00 | R$312.97 |
| GESTÃO DE SERVIÇOS JURÍDICOS E NOTARIAIS | 11 | R$133.40 | R$389.70 |
| GESTÃO DE TECNOLOGIA DA INFORMAÇÃO | 3 | R$129.00 | R$346.64 |
| GESTÃO DE TURISMO | 2 | R$132.33 | R$239.99 |
| GESTÃO DESPORTIVA E DE LAZER | 1 | R$265.31 | R$265.31 |
| GESTÃO DO AGRONEGÓCIO | 2 | R$159.00 | R$279.00 |
| GESTÃO DO TERCEIRO SETOR | 1 | R$333.31 | R$333.31 |
| GESTÃO DO TRÂNSITO | 1 | R$254.49 | R$254.49 |
| GESTÃO E EMPREENDEDORISMO | 6 | R$124.70 | R$438.00 |
| GESTÃO E ORGANIZAÇÃO DE COOPERATIVAS | 1 | R$132.33 | R$132.33 |
| GESTÃO E PRODUÇÃO CERVEJEIRA | 1 | R$459.16 | R$459.16 |
| GESTÃO EMPRESARIAL E DE NEGÓCIOS | 1 | R$221.26 | R$221.26 |
| GESTÃO FINANCEIRA | 37 | R$106.70 | R$860.00 |
| GESTÃO HOSPITALAR | 29 | R$99.00 | R$540.00 |
| GESTÃO PORTUÁRIA | 1 | R$256.47 | R$256.47 |
| GESTÃO PUBLICA | 1 | R$288.90 | R$288.90 |
| GESTÃO PÚBLICA | 35 | R$99.00 | R$860.00 |
| HISTÓRIA | 32 | R$121.98 | R$465.00 |
| HOTELARIA | 3 | R$514.14 | R$663.33 |
| INFORMÁTICA | 1 | R$291.45 | R$291.45 |
| INTERDISCIPLINAR EM CIÊNCIAS DO TRABALHO | 9 | R$230.99 | R$434.20 |
| INTERDISCIPLINAR EM CIÊNCIAS HUMANAS | 2 | R$241.58 | R$428.42 |
| INTERNET DAS COISAS | 1 | R$272.55 | R$272.55 |
| INVESTIGAÇÃO FORENSE E PERÍCIA CRIMINAL | 2 | R$251.04 | R$397.56 |
| INVESTIGAÇÃO PROFISSIONAL | 1 | R$325.80 | R$325.80 |
| JOGOS DIGITAIS | 15 | R$133.40 | R$758.07 |
| JORNALISMO | 1 | R$154.06 | R$154.06 |
| LETRAS | 25 | R$109.90 | R$465.00 |
| LETRAS - ESPANHOL | 9 | R$109.90 | R$385.75 |
| LETRAS - INGLÊS | 11 | R$109.90 | R$385.75 |
| LETRAS - LIBRAS | 4 | R$199.99 | R$367.71 |
| LETRAS - LÍNGUA PORTUGUESA | 1 | R$199.99 | R$199.99 |
| LETRAS - PORTUGUES E INGLÊS | 1 | R$272.55 | R$272.55 |
| LETRAS - PORTUGUÊS E ESPANHOL | 1 | R$272.55 | R$272.55 |
| LETRAS - PORTUGUÊS E LITERATURA | 1 | R$199.99 | R$199.99 |
| LETRAS PORTUGUÊS E INGLÊS | 1 | R$275.00 | R$275.00 |
| LETRAS- PORTUGUÊS | 1 | R$224.11 | R$224.11 |
| LICENCIATURA INTERCULTURAL - COMUNICAÇÃO E ARTES | 8 | R$129.00 | R$433.24 |
| LOGÍSTICA | 39 | R$99.00 | R$860.00 |
| MARKETING | 36 | R$99.00 | R$860.00 |
| MARKETING DIGITAL | 6 | R$129.00 | R$346.64 |
| MATEMÁTICA | 23 | R$159.00 | R$600.24 |
| MECATRÔNICA | 1 | R$254.15 | R$254.15 |
| MEDIAÇÃO | 5 | R$251.04 | R$496.67 |
| MEDICINA VETERINÁRIA | 2 | R$1224.03 | R$2762.50 |
| MODA | 1 | R$288.90 | R$288.90 |
| MUSEOLOGIA | 2 | R$318.37 | R$411.97 |
| Mecatrônica Industrial | 1 | R$299.00 | R$299.00 |
| MÚSICA | 4 | R$310.03 | R$472.74 |
| NEGÓCIOS DIGITAIS | 1 | R$264.73 | R$264.73 |
| NEGÓCIOS IMOBILIÁRIOS | 12 | R$104.00 | R$540.00 |
| NUTRIÇÃO | 11 | R$249.20 | R$1147.54 |
| ODONTOLOGIA | 2 | R$311.11 | R$2477.78 |
| PEDAGOGIA | 44 | R$99.00 | R$467.92 |
| PODOLOGIA | 4 | R$149.90 | R$679.92 |
| PROCESSOS ESCOLARES | 2 | R$159.00 | R$374.70 |
| PROCESSOS GERENCIAIS | 34 | R$106.70 | R$860.00 |
| PROCESSOS QUIMICOS | 1 | R$209.30 | R$209.30 |
| PRODUÇÃO CULTURAL | 10 | R$249.90 | R$496.67 |
| PRODUÇÃO INDUSTRIAL | 4 | R$159.00 | R$299.00 |
| PRODUÇÃO MULTIMÍDIA | 1 | R$715.99 | R$715.99 |
| PRODUÇÃO PUBLICITÁRIA | 1 | R$189.01 | R$189.01 |
| PSICOLOGIA | 2 | R$276.52 | R$1873.21 |
| PSICOPEDAGOGIA | 6 | R$154.95 | R$453.31 |
| PUBLICIDADE | 2 | R$288.90 | R$540.00 |
| QUÍMICA | 8 | R$134.20 | R$427.00 |
| RADIOLOGIA | 4 | R$571.29 | R$1142.86 |
| REDES DE COMPUTADORES | 11 | R$122.97 | R$758.07 |
| RELAÇÕES INTERNACIONAIS | 8 | R$149.00 | R$453.31 |
| ROCHAS ORNAMENTAIS | 3 | R$417.54 | R$596.67 |
| SANEAMENTO AMBIENTAL | 1 | R$256.47 | R$256.47 |
| SAÚDE | 2 | R$321.00 | R$396.60 |
| SAÚDE PÚBLICA | 4 | R$256.47 | R$377.77 |
| SECRETARIADO | 8 | R$133.10 | R$333.31 |
| SEGURANÇA DA INFORMAÇÃO | 10 | R$129.00 | R$489.56 |
| SEGURANÇA DO TRABALHO | 11 | R$99.00 | R$455.59 |
| SEGURANÇA PRIVADA | 13 | R$140.67 | R$496.67 |
| SEGURANÇA PÚBLICA | 16 | R$133.40 | R$647.35 |
| SEGUROS E PREVIDÊNCIA | 1 | R$256.47 | R$256.47 |
| SERVIÇO SOCIAL | 22 | R$0.00 | R$468.52 |
| SERVIÇOS JUDICIÁRIOS | 1 | R$324.00 | R$324.00 |
| SERVIÇOS JURÍDICOS | 1 | R$272.55 | R$272.55 |
| SERVIÇOS JURÍDICOS E NOTARIAIS | 7 | R$129.00 | R$496.67 |
| SERVIÇOS NOTARIAIS | 1 | R$437.74 | R$437.74 |
| SERVIÇOS PENAIS | 3 | R$256.47 | R$437.74 |
| SISTEMAS BIOMÉDICOS | 6 | R$249.00 | R$514.85 |
| SISTEMAS DE INFORMAÇÃO | 10 | R$122.97 | R$1391.07 |
| SISTEMAS PARA INTERNET | 4 | R$266.00 | R$437.74 |
| SOCIOLOGIA | 3 | R$223.60 | R$399.86 |
| TEATRO | 1 | R$557.00 | R$557.00 |
| TECNOLOGIAS EDUCACIONAIS | 1 | R$359.86 | R$359.86 |
| TEOLOGIA | 18 | R$159.00 | R$506.20 |
| TERAPIA OCUPACIONAL | 1 | R$517.50 | R$517.50 |
| TERAPIAS INTEGRATIVAS E COMPLEMENTARES | 1 | R$439.97 | R$439.97 |
| TURISMO | 4 | R$159.00 | R$637.25 |
mensalidades_curso = mensalidades_agg[mensalidades_agg.modalidade == 'Presencial']
mensalidades_curso = mensalidades_curso.groupby(['curso']).agg(qtd_ofertas=('curso','count'), preco_medio=('preco_cheio','mean'), menor_preco=('preco_cheio','min'), maior_preco=('preco_cheio','max'), desvio_padrao=('preco_cheio', np.std)).reset_index()
mensalidades_curso['preco_medio'] = round(mensalidades_curso['preco_medio'],2)
mensalidades_curso['menor_preco'] = round(mensalidades_curso['menor_preco'],2)
mensalidades_curso['maior_preco'] = round(mensalidades_curso['maior_preco'],2)
mensalidades_curso['desvio_padrao'] = round(mensalidades_curso['desvio_padrao'],2)
mensalidades_curso = mensalidades_curso.fillna(0)
df = mensalidades_curso.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_medio'] = df['preco_medio'].apply(format)
df['menor_preco'] = df['menor_preco'].apply(format)
df['maior_preco'] = df['maior_preco'].apply(format)
df['desvio_padrao'] = df['desvio_padrao'].apply(format)
df = df[['curso','qtd_ofertas','menor_preco','maior_preco']].copy()
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
header=dict(values=['Curso', 'Ofertas', 'Menor Preço','Maior Preço'],
height=40,
fill_color='#6BAED6',
align='left'),
cells=dict(values=[df.curso,df.qtd_ofertas,df.menor_preco,df.maior_preco],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=60))
])
fig.add_annotation(
xref='x domain', yref='y2 domain', x=1.0, y=-1, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| curso | qtd_ofertas | menor_preco | maior_preco |
|:----------------------------------------------|--------------:|:--------------|:--------------|
| ADMINISTRAÇÃO | 13 | R$199.00 | R$1286.46 |
| AGROCOMPUTAÇÃO | 1 | R$463.67 | R$463.67 |
| AGROINDÚSTRIA | 1 | R$348.00 | R$348.00 |
| AGRONEGÓCIOS E AGRICULTURA | 1 | R$500.00 | R$500.00 |
| ALIMENTOS | 1 | R$358.00 | R$358.00 |
| ANÁLISE DE SISTEMAS | 1 | R$592.00 | R$592.00 |
| ANÁLISE E DESENVOLVIMENTO DE SISTEMAS | 3 | R$303.00 | R$1348.32 |
| ARQUITETURA E URBANISMO | 3 | R$1424.00 | R$2271.96 |
| AUTOMAÇÃO INDUSTRIAL | 1 | R$568.00 | R$568.00 |
| BIOMEDICINA | 4 | R$1056.00 | R$1947.29 |
| CIÊNCIA DA COMPUTAÇÃO | 2 | R$374.00 | R$1075.36 |
| CIÊNCIAS CONTÁBEIS | 11 | R$199.00 | R$1286.22 |
| COMUNICAÇÃO SOCIAL | 1 | R$1175.00 | R$1175.00 |
| COMUNICAÇÃO SOCIAL - PRODUÇÃO EDITORIAL | 1 | R$1175.00 | R$1175.00 |
| COMUNICAÇÃO SOCIAL - PUBLICIDADE E PROPAGANDA | 2 | R$1064.00 | R$1462.98 |
| DIREITO | 9 | R$550.00 | R$1945.28 |
| ECONOMIA DOMÉSTICA | 1 | R$450.00 | R$450.00 |
| EDUCAÇÃO FÍSICA | 4 | R$450.00 | R$1220.34 |
| ENFERMAGEM | 6 | R$610.00 | R$1821.91 |
| ENGENHARIA CIVIL | 4 | R$883.03 | R$1589.96 |
| ENGENHARIA DE CONTROLE E AUTOMAÇÃO | 2 | R$590.00 | R$938.78 |
| ENGENHARIA DE PRODUÇÃO | 5 | R$516.67 | R$2821.23 |
| ENGENHARIA ELÉTRICA | 1 | R$1374.00 | R$1374.00 |
| ENGENHARIA MECÂNICA | 2 | R$867.28 | R$1305.00 |
| ESTETICA, COSMETICA, BELEZA E IMAGEM PESSOAL | 1 | R$792.00 | R$792.00 |
| FARMÁCIA E BIOQUÍMICA | 2 | R$1041.00 | R$1553.16 |
| FISIOTERAPIA | 4 | R$670.00 | R$2271.96 |
| GESTÃO DA QUALIDADE | 1 | R$355.50 | R$355.50 |
| GESTÃO DE RECURSOS HUMANOS | 7 | R$234.74 | R$763.63 |
| GESTÃO FINANCEIRA | 1 | R$592.00 | R$592.00 |
| GESTÃO HOSPITALAR | 1 | R$250.00 | R$250.00 |
| GESTÃO PÚBLICA | 2 | R$260.05 | R$437.00 |
| LETRAS | 1 | R$280.00 | R$280.00 |
| LOGÍSTICA | 3 | R$356.33 | R$537.96 |
| MARKETING | 3 | R$519.15 | R$775.95 |
| MEDICINA | 1 | R$12800.00 | R$12800.00 |
| MEDICINA VETERINÁRIA | 1 | R$1925.00 | R$1925.00 |
| NUTRIÇÃO | 3 | R$1056.00 | R$2024.31 |
| ODONTOLOGIA | 2 | R$2200.00 | R$4396.03 |
| OPTOMETRIA | 1 | R$990.00 | R$990.00 |
| PEDAGOGIA | 5 | R$199.00 | R$715.00 |
| PROCESSOS GERENCIAIS | 3 | R$355.50 | R$775.95 |
| PSICOLOGIA | 4 | R$967.12 | R$1813.00 |
| QUÍMICA | 1 | R$715.00 | R$715.00 |
| RADIOLOGIA | 1 | R$657.00 | R$657.00 |
| REDES DE COMPUTADORES | 3 | R$303.00 | R$775.95 |
| SEGURANÇA PÚBLICA | 1 | R$437.00 | R$437.00 |
| SERVIÇO SOCIAL | 2 | R$593.00 | R$1010.09 |
| SISTEMAS BIOMÉDICOS | 1 | R$406.67 | R$406.67 |
| SISTEMAS DE INFORMAÇÃO | 1 | R$1175.00 | R$1175.00 |
mensalidades_curso = mensalidades_agg.groupby(['curso','modalidade']).agg(qtd_ofertas=('curso','count'),preco_cheio_medio=('preco_cheio','mean'),preco_desconto_medio=('preco_desconto','mean')).reset_index()
mensalidades_curso.sort_values(by='curso',ascending=True,inplace=True)
mensalidades_curso['preco_cheio_medio'] = round(mensalidades_curso['preco_cheio_medio'],2)
mensalidades_curso['preco_desconto_medio'] = round(mensalidades_curso['preco_desconto_medio'],2)
mensalidades_curso = mensalidades_curso[mensalidades_curso.modalidade == 'EAD']
mensalidades_curso = mensalidades_curso[['curso', 'qtd_ofertas', 'preco_cheio_medio', 'preco_desconto_medio']].copy()
df = mensalidades_curso.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_cheio_medio'] = df['preco_cheio_medio'].apply(format)
df['preco_desconto_medio'] = df['preco_desconto_medio'].apply(format)
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
header=dict(values=['Curso', 'Ofertas', 'Preço Tabela','Preço com Desconto'],
height=40,
fill_color='#6BAED6',
align='left'),
cells=dict(values=[df.curso,df.qtd_ofertas,df.preco_cheio_medio,df.preco_desconto_medio],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=60))
])
fig.add_annotation(
xref='x domain', yref='y2 domain', x=1.0, y=-1, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
df.drop(columns=['index'],inplace=True)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| curso | qtd_ofertas | preco_cheio_medio | preco_desconto_medio |
|:-------------------------------------------------|--------------:|:--------------------|:-----------------------|
| ADMINISTRAÇÃO | 45 | R$315.59 | R$242.28 |
| ADMINISTRAÇÃO PÚBLICA | 4 | R$328.66 | R$198.55 |
| AGRONEGÓCIOS E AGRICULTURA | 12 | R$385.81 | R$250.58 |
| AGRONOMIA | 1 | R$249.90 | R$249.90 |
| ALIMENTOS | 1 | R$305.00 | R$274.50 |
| ANÁLISE DE DADOS | 1 | R$335.33 | R$301.80 |
| ANÁLISE E DESENVOLVIMENTO DE SISTEMAS | 30 | R$306.44 | R$232.06 |
| ARQUITETURA E URBANISMO | 6 | R$707.59 | R$365.58 |
| ARQUIVOLOGIA E BIBLIOTECONOMIA | 1 | R$318.37 | R$257.08 |
| ARTES | 1 | R$149.90 | R$149.90 |
| ARTES PLÁSTICAS E VISUAIS | 14 | R$308.52 | R$209.75 |
| ARTES VISUAIS | 3 | R$306.44 | R$226.22 |
| ASSESSORIA EXECUTIVA DIGITAL | 1 | R$273.14 | R$219.38 |
| BANCO DE DADOS | 6 | R$369.44 | R$252.07 |
| BIBLIOTECONOMIA | 3 | R$342.21 | R$309.15 |
| BIG DATA | 2 | R$343.24 | R$211.05 |
| BIG DATA E INTELIGÊNCIA ANALÍTICA | 2 | R$349.84 | R$243.06 |
| BIOLOGIA | 16 | R$314.18 | R$220.49 |
| BIOMEDICINA | 8 | R$671.80 | R$397.15 |
| CIÊNCIA DA COMPUTAÇÃO | 8 | R$530.21 | R$276.04 |
| CIÊNCIA DE DADOS | 3 | R$416.30 | R$287.20 |
| CIÊNCIAS AERONÁUTICAS | 6 | R$849.44 | R$597.69 |
| CIÊNCIAS BIOLÓGICAS | 3 | R$265.61 | R$251.65 |
| CIÊNCIAS CONTÁBEIS | 42 | R$322.12 | R$244.71 |
| CIÊNCIAS DA NATUREZA | 1 | R$392.92 | R$174.61 |
| CIÊNCIAS DA RELIGIÃO | 5 | R$261.22 | R$215.13 |
| CIÊNCIAS ECONÔMICAS | 24 | R$361.46 | R$242.70 |
| CIÊNCIAS ECONÔMICAS E DE INVESTIMENTOS | 1 | R$302.00 | R$271.80 |
| CIÊNCIAS EXATAS | 1 | R$383.83 | R$161.63 |
| CIÊNCIAS POLÍTICAS | 8 | R$383.24 | R$275.65 |
| CIÊNCIAS SOCIAIS | 6 | R$313.42 | R$217.42 |
| COACH DIGITAL | 3 | R$270.79 | R$183.02 |
| COACH E MENTORING | 3 | R$231.73 | R$172.76 |
| COMUNICAÇÃO INSTITUCIONAL | 3 | R$294.08 | R$215.40 |
| COMUNICAÇÃO SOCIAL | 6 | R$604.84 | R$318.62 |
| COMUNICAÇÃO SOCIAL - PUBLICIDADE E PROPAGANDA | 1 | R$413.37 | R$336.74 |
| COMUNICAÇÃO SOCIAL - JORNALISMO | 2 | R$346.62 | R$284.02 |
| COMUNICAÇÃO SOCIAL - MÍDIAS DIGITAIS | 1 | R$273.14 | R$219.34 |
| COMUNICAÇÃO SOCIAL - PRODUÇÃO EDITORIAL | 7 | R$526.75 | R$344.64 |
| COMUNICAÇÃO SOCIAL - PRODUÇÃO MULTIMÍDIA | 3 | R$381.47 | R$287.16 |
| COMUNICAÇÃO SOCIAL - PUBLICIDADE E PROPAGANDA | 2 | R$355.45 | R$329.45 |
| COMÉRCIO EXTERIOR | 19 | R$291.38 | R$213.62 |
| CONSTRUÇÃO DE EDIFÍCIOS | 1 | R$480.84 | R$388.28 |
| DATA SCIENCE | 6 | R$258.80 | R$150.58 |
| DEFESA CIBERNÉTICA | 2 | R$270.68 | R$181.10 |
| DESIGN | 1 | R$514.14 | R$359.90 |
| DESIGN DE ANIMAÇÃO | 4 | R$446.17 | R$276.34 |
| DESIGN DE INTERIORES | 16 | R$383.85 | R$276.97 |
| DESIGN DE MODA | 5 | R$390.16 | R$315.13 |
| DESIGN DE PRODUTO | 5 | R$388.67 | R$251.65 |
| DESIGN GRÁFICO | 6 | R$430.61 | R$298.49 |
| DIREITO | 1 | R$1605.36 | R$628.96 |
| ECONOMIA DOMÉSTICA | 4 | R$339.94 | R$307.58 |
| EDUCAÇÃO ESPECIAL | 12 | R$282.59 | R$222.17 |
| EDUCAÇÃO FISICA | 2 | R$239.90 | R$239.90 |
| EDUCAÇÃO FÍSICA | 22 | R$411.25 | R$288.04 |
| EDUCAÇÃO FÍSICA (GRADUAÇÃO PLENA) | 1 | R$134.50 | R$134.50 |
| EMBELEZAMENTO E IMAGEM PESSOAL | 1 | R$458.58 | R$224.00 |
| EMPREENDEDORISMO | 7 | R$234.95 | R$145.46 |
| ENFERMAGEM | 5 | R$779.35 | R$429.66 |
| ENGENHARIA AMBIENTAL | 6 | R$573.37 | R$396.86 |
| ENGENHARIA AMBIENTAL E SANITÁRIA | 3 | R$541.90 | R$438.40 |
| ENGENHARIA CIVIL | 14 | R$612.57 | R$395.30 |
| ENGENHARIA DA COMPUTAÇÃO | 5 | R$658.44 | R$400.13 |
| ENGENHARIA DE COMPUTAÇÃO | 5 | R$601.23 | R$434.34 |
| ENGENHARIA DE CONTROLE E AUTOMAÇÃO | 3 | R$663.01 | R$399.30 |
| ENGENHARIA DE PRODUÇÃO | 21 | R$502.06 | R$374.60 |
| ENGENHARIA DE SOFTWARE | 9 | R$484.19 | R$367.82 |
| ENGENHARIA ELÉTRICA | 15 | R$648.30 | R$443.39 |
| ENGENHARIA MECATRÔNICA | 3 | R$423.32 | R$326.43 |
| ENGENHARIA MECÂNICA | 11 | R$669.36 | R$396.77 |
| ENGENHARIA QUÍMICA | 1 | R$178.00 | R$178.00 |
| ENGENHARIA SANITÁRIA | 1 | R$278.85 | R$237.54 |
| ESPORTE E GESTÃO DESPORTIVA | 2 | R$240.74 | R$205.02 |
| ESTATÍSTICA | 2 | R$539.17 | R$269.59 |
| ESTETICA, COSMETICA, BELEZA E IMAGEM PESSOAL | 10 | R$471.65 | R$322.17 |
| ESTÉTICA | 2 | R$223.95 | R$223.95 |
| EVENTOS | 5 | R$364.34 | R$228.48 |
| FARMÁCIA E BIOQUÍMICA | 9 | R$579.00 | R$368.05 |
| FILMMAKER | 3 | R$270.79 | R$183.02 |
| FILOSOFIA | 18 | R$309.94 | R$224.15 |
| FINANÇAS | 1 | R$273.14 | R$219.38 |
| FISIOTERAPIA | 9 | R$668.72 | R$400.48 |
| FONOAUDIOLOGIA | 1 | R$3199.24 | R$917.06 |
| FORMAÇÃO DE PROFESSORES | 2 | R$240.58 | R$240.58 |
| FOTOGRAFIA | 4 | R$504.88 | R$303.48 |
| FÍSICA | 9 | R$264.34 | R$219.61 |
| GASTRONOMIA | 15 | R$518.95 | R$347.14 |
| GEOGRAFIA | 20 | R$271.80 | R$200.50 |
| GEOPROCESSAMENTO | 1 | R$480.84 | R$388.28 |
| GERONTOLOGIA | 6 | R$278.90 | R$188.47 |
| GESTÃO AMBIENTAL | 32 | R$284.29 | R$214.30 |
| GESTÃO BANCÁRIA | 2 | R$283.40 | R$216.66 |
| GESTÃO COMERCIAL | 33 | R$298.20 | R$230.18 |
| GESTÃO DA PRODUÇÃO INDUSTRIAL | 1 | R$272.55 | R$272.55 |
| GESTÃO DA QUALIDADE | 21 | R$270.61 | R$215.70 |
| GESTÃO DA TECNOLOGIA DA INFORMAÇÃO | 17 | R$314.34 | R$242.42 |
| GESTÃO DA VIGILÂNCIA EM SAÚDE | 1 | R$247.86 | R$185.90 |
| GESTÃO DAS ORGANIZAÇÕES DO TERCEIRO SETOR | 2 | R$200.55 | R$181.65 |
| GESTÃO DE COOPERATIVAS | 2 | R$282.88 | R$256.56 |
| GESTÃO DE E-COMMERCE | 2 | R$247.94 | R$195.24 |
| GESTÃO DE EMERGÊNCIAS | 1 | R$277.78 | R$250.00 |
| GESTÃO DE PROCESSOS SECRETARIAIS E ESCOLARES | 1 | R$311.11 | R$280.00 |
| GESTÃO DE RECURSOS HUMANOS | 44 | R$289.80 | R$221.26 |
| GESTÃO DE SAÚDE | 1 | R$264.51 | R$158.71 |
| GESTÃO DE SERVIÇOS JURÍDICOS | 2 | R$306.98 | R$219.95 |
| GESTÃO DE SERVIÇOS JURÍDICOS E NOTARIAIS | 11 | R$262.54 | R$201.24 |
| GESTÃO DE TECNOLOGIA DA INFORMAÇÃO | 3 | R$248.51 | R$193.63 |
| GESTÃO DE TURISMO | 2 | R$186.16 | R$186.16 |
| GESTÃO DESPORTIVA E DE LAZER | 1 | R$265.31 | R$99.49 |
| GESTÃO DO AGRONEGÓCIO | 2 | R$219.00 | R$219.00 |
| GESTÃO DO TERCEIRO SETOR | 1 | R$333.31 | R$174.99 |
| GESTÃO DO TRÂNSITO | 1 | R$254.49 | R$194.61 |
| GESTÃO E EMPREENDEDORISMO | 6 | R$268.91 | R$217.74 |
| GESTÃO E ORGANIZAÇÃO DE COOPERATIVAS | 1 | R$132.33 | R$132.33 |
| GESTÃO E PRODUÇÃO CERVEJEIRA | 1 | R$459.16 | R$413.25 |
| GESTÃO EMPRESARIAL E DE NEGÓCIOS | 1 | R$221.26 | R$221.26 |
| GESTÃO FINANCEIRA | 37 | R$304.04 | R$227.81 |
| GESTÃO HOSPITALAR | 29 | R$289.07 | R$210.64 |
| GESTÃO PORTUÁRIA | 1 | R$256.47 | R$207.10 |
| GESTÃO PUBLICA | 1 | R$288.90 | R$288.90 |
| GESTÃO PÚBLICA | 35 | R$308.99 | R$225.74 |
| HISTÓRIA | 32 | R$269.29 | R$211.94 |
| HOTELARIA | 3 | R$586.38 | R$346.86 |
| INFORMÁTICA | 1 | R$291.45 | R$245.10 |
| INTERDISCIPLINAR EM CIÊNCIAS DO TRABALHO | 9 | R$328.72 | R$193.85 |
| INTERDISCIPLINAR EM CIÊNCIAS HUMANAS | 2 | R$335.00 | R$177.18 |
| INTERNET DAS COISAS | 1 | R$272.55 | R$272.55 |
| INVESTIGAÇÃO FORENSE E PERÍCIA CRIMINAL | 2 | R$324.30 | R$196.13 |
| INVESTIGAÇÃO PROFISSIONAL | 1 | R$325.80 | R$277.53 |
| JOGOS DIGITAIS | 15 | R$396.03 | R$297.91 |
| JORNALISMO | 1 | R$154.06 | R$154.06 |
| LETRAS | 25 | R$273.34 | R$199.70 |
| LETRAS - ESPANHOL | 9 | R$253.31 | R$178.99 |
| LETRAS - INGLÊS | 11 | R$251.89 | R$186.67 |
| LETRAS - LIBRAS | 4 | R$284.40 | R$224.13 |
| LETRAS - LÍNGUA PORTUGUESA | 1 | R$199.99 | R$199.99 |
| LETRAS - PORTUGUES E INGLÊS | 1 | R$272.55 | R$272.55 |
| LETRAS - PORTUGUÊS E ESPANHOL | 1 | R$272.55 | R$272.55 |
| LETRAS - PORTUGUÊS E LITERATURA | 1 | R$199.99 | R$199.99 |
| LETRAS PORTUGUÊS E INGLÊS | 1 | R$275.00 | R$275.00 |
| LETRAS- PORTUGUÊS | 1 | R$224.11 | R$224.11 |
| LICENCIATURA INTERCULTURAL - COMUNICAÇÃO E ARTES | 8 | R$276.91 | R$208.74 |
| LOGÍSTICA | 39 | R$298.92 | R$223.95 |
| MARKETING | 36 | R$291.33 | R$223.75 |
| MARKETING DIGITAL | 6 | R$301.91 | R$201.57 |
| MATEMÁTICA | 23 | R$303.28 | R$214.58 |
| MECATRÔNICA | 1 | R$254.15 | R$194.35 |
| MEDIAÇÃO | 5 | R$376.42 | R$228.00 |
| MEDICINA VETERINÁRIA | 2 | R$1993.26 | R$1100.49 |
| MODA | 1 | R$288.90 | R$288.90 |
| MUSEOLOGIA | 2 | R$365.17 | R$313.93 |
| Mecatrônica Industrial | 1 | R$299.00 | R$299.00 |
| MÚSICA | 4 | R$386.38 | R$337.12 |
| NEGÓCIOS DIGITAIS | 1 | R$264.73 | R$223.76 |
| NEGÓCIOS IMOBILIÁRIOS | 12 | R$236.93 | R$194.61 |
| NUTRIÇÃO | 11 | R$637.80 | R$392.22 |
| ODONTOLOGIA | 2 | R$1394.45 | R$852.00 |
| PEDAGOGIA | 44 | R$262.32 | R$205.08 |
| PODOLOGIA | 4 | R$422.72 | R$337.56 |
| PROCESSOS ESCOLARES | 2 | R$266.85 | R$160.38 |
| PROCESSOS GERENCIAIS | 34 | R$285.90 | R$214.11 |
| PROCESSOS QUIMICOS | 1 | R$209.30 | R$209.30 |
| PRODUÇÃO CULTURAL | 10 | R$356.56 | R$205.60 |
| PRODUÇÃO INDUSTRIAL | 4 | R$239.74 | R$229.74 |
| PRODUÇÃO MULTIMÍDIA | 1 | R$715.99 | R$357.99 |
| PRODUÇÃO PUBLICITÁRIA | 1 | R$189.01 | R$189.01 |
| PSICOLOGIA | 2 | R$1074.86 | R$489.37 |
| PSICOPEDAGOGIA | 6 | R$323.19 | R$264.12 |
| PUBLICIDADE | 2 | R$414.45 | R$252.45 |
| QUÍMICA | 8 | R$306.10 | R$249.15 |
| RADIOLOGIA | 4 | R$723.63 | R$402.67 |
| REDES DE COMPUTADORES | 11 | R$350.74 | R$219.04 |
| RELAÇÕES INTERNACIONAIS | 8 | R$320.56 | R$241.81 |
| ROCHAS ORNAMENTAIS | 3 | R$498.63 | R$258.06 |
| SANEAMENTO AMBIENTAL | 1 | R$256.47 | R$207.10 |
| SAÚDE | 2 | R$358.80 | R$247.97 |
| SAÚDE PÚBLICA | 4 | R$307.18 | R$193.41 |
| SECRETARIADO | 8 | R$251.79 | R$218.96 |
| SEGURANÇA DA INFORMAÇÃO | 10 | R$250.98 | R$199.98 |
| SEGURANÇA DO TRABALHO | 11 | R$261.08 | R$186.55 |
| SEGURANÇA PRIVADA | 13 | R$305.69 | R$201.85 |
| SEGURANÇA PÚBLICA | 16 | R$338.07 | R$203.87 |
| SEGUROS E PREVIDÊNCIA | 1 | R$256.47 | R$207.10 |
| SERVIÇO SOCIAL | 22 | R$278.75 | R$217.02 |
| SERVIÇOS JUDICIÁRIOS | 1 | R$324.00 | R$218.70 |
| SERVIÇOS JURÍDICOS | 1 | R$272.55 | R$272.55 |
| SERVIÇOS JURÍDICOS E NOTARIAIS | 7 | R$285.73 | R$213.85 |
| SERVIÇOS NOTARIAIS | 1 | R$437.74 | R$241.28 |
| SERVIÇOS PENAIS | 3 | R$342.51 | R$207.79 |
| SISTEMAS BIOMÉDICOS | 6 | R$387.15 | R$241.47 |
| SISTEMAS DE INFORMAÇÃO | 10 | R$496.61 | R$316.49 |
| SISTEMAS PARA INTERNET | 4 | R$324.32 | R$268.71 |
| SOCIOLOGIA | 3 | R$310.99 | R$169.18 |
| TEATRO | 1 | R$557.00 | R$389.90 |
| TECNOLOGIAS EDUCACIONAIS | 1 | R$359.86 | R$179.93 |
| TEOLOGIA | 18 | R$313.90 | R$210.91 |
| TERAPIA OCUPACIONAL | 1 | R$517.50 | R$465.75 |
| TERAPIAS INTEGRATIVAS E COMPLEMENTARES | 1 | R$439.97 | R$230.99 |
| TURISMO | 4 | R$403.00 | R$214.71 |
mensalidades_curso = mensalidades_agg.groupby(['curso','modalidade']).agg(qtd_ofertas=('curso','count'),preco_cheio_medio=('preco_cheio','mean'),preco_desconto_medio=('preco_desconto','mean')).reset_index()
mensalidades_curso.sort_values(by='curso',ascending=True,inplace=True)
mensalidades_curso['preco_cheio_medio'] = round(mensalidades_curso['preco_cheio_medio'],2)
mensalidades_curso['preco_desconto_medio'] = round(mensalidades_curso['preco_desconto_medio'],2)
mensalidades_curso = mensalidades_curso[mensalidades_curso.modalidade == 'Presencial']
mensalidades_curso = mensalidades_curso[['curso', 'qtd_ofertas', 'preco_cheio_medio', 'preco_desconto_medio']].copy()
df = mensalidades_curso.reset_index()
def format(x):
return "R${:.2f}".format(x)
df['preco_cheio_medio'] = df['preco_cheio_medio'].apply(format)
df['preco_desconto_medio'] = df['preco_desconto_medio'].apply(format)
fig = go.Figure(data=[go.Table(
columnwidth = [40,35,35,35],
header=dict(values=['Curso', 'Ofertas', 'Preço Tabela','Preço com Desconto'],
height=40,
fill_color='#6BAED6',
align='left'),
cells=dict(values=[df.curso,df.qtd_ofertas,df.preco_cheio_medio,df.preco_desconto_medio],
fill_color='lavender',
align=['left','left','left','left'],
fill=dict(color=['#6BAED6', 'white']),
font_size=[14,14,14,14],
height=60))
])
fig.add_annotation(
xref='x domain', yref='y2 domain', x=1.0, y=-1, text='Fonte: INEP - Censo Educacional (2019), IBGE - Censo (2010)',
showarrow=False, arrowhead=1
)
df.drop(columns=['index'],inplace=True)
if len(df.index) > 0:
print(df.to_markdown(index=False))
else:
print('Não há cursos neste município.')
| curso | qtd_ofertas | preco_cheio_medio | preco_desconto_medio |
|:----------------------------------------------|--------------:|:--------------------|:-----------------------|
| ADMINISTRAÇÃO | 13 | R$797.03 | R$501.83 |
| AGROCOMPUTAÇÃO | 1 | R$463.67 | R$449.57 |
| AGROINDÚSTRIA | 1 | R$348.00 | R$313.20 |
| AGRONEGÓCIOS E AGRICULTURA | 1 | R$500.00 | R$364.00 |
| ALIMENTOS | 1 | R$358.00 | R$340.60 |
| ANÁLISE DE SISTEMAS | 1 | R$592.00 | R$474.00 |
| ANÁLISE E DESENVOLVIMENTO DE SISTEMAS | 3 | R$697.61 | R$370.85 |
| ARQUITETURA E URBANISMO | 3 | R$1725.08 | R$870.67 |
| AUTOMAÇÃO INDUSTRIAL | 1 | R$568.00 | R$568.00 |
| BIOMEDICINA | 4 | R$1490.89 | R$655.64 |
| CIÊNCIA DA COMPUTAÇÃO | 2 | R$724.68 | R$523.46 |
| CIÊNCIAS CONTÁBEIS | 11 | R$796.42 | R$497.24 |
| COMUNICAÇÃO SOCIAL | 1 | R$1175.00 | R$764.00 |
| COMUNICAÇÃO SOCIAL - PRODUÇÃO EDITORIAL | 1 | R$1175.00 | R$705.00 |
| COMUNICAÇÃO SOCIAL - PUBLICIDADE E PROPAGANDA | 2 | R$1263.49 | R$893.24 |
| DIREITO | 9 | R$1279.58 | R$809.18 |
| ECONOMIA DOMÉSTICA | 1 | R$450.00 | R$450.00 |
| EDUCAÇÃO FÍSICA | 4 | R$887.00 | R$522.88 |
| ENFERMAGEM | 6 | R$1444.76 | R$696.15 |
| ENGENHARIA CIVIL | 4 | R$1340.81 | R$1015.06 |
| ENGENHARIA DE CONTROLE E AUTOMAÇÃO | 2 | R$764.39 | R$610.52 |
| ENGENHARIA DE PRODUÇÃO | 5 | R$1369.78 | R$871.34 |
| ENGENHARIA ELÉTRICA | 1 | R$1374.00 | R$961.80 |
| ENGENHARIA MECÂNICA | 2 | R$1086.14 | R$798.58 |
| ESTETICA, COSMETICA, BELEZA E IMAGEM PESSOAL | 1 | R$792.00 | R$594.00 |
| FARMÁCIA E BIOQUÍMICA | 2 | R$1297.08 | R$833.60 |
| FISIOTERAPIA | 4 | R$1389.78 | R$752.14 |
| GESTÃO DA QUALIDADE | 1 | R$355.50 | R$339.85 |
| GESTÃO DE RECURSOS HUMANOS | 7 | R$489.81 | R$343.91 |
| GESTÃO FINANCEIRA | 1 | R$592.00 | R$532.80 |
| GESTÃO HOSPITALAR | 1 | R$250.00 | R$250.00 |
| GESTÃO PÚBLICA | 2 | R$348.52 | R$244.28 |
| LETRAS | 1 | R$280.00 | R$280.00 |
| LOGÍSTICA | 3 | R$476.76 | R$346.43 |
| MARKETING | 3 | R$629.03 | R$468.51 |
| MEDICINA | 1 | R$12800.00 | R$9800.00 |
| MEDICINA VETERINÁRIA | 1 | R$1925.00 | R$1251.00 |
| NUTRIÇÃO | 3 | R$1541.36 | R$728.98 |
| ODONTOLOGIA | 2 | R$3298.02 | R$1498.80 |
| OPTOMETRIA | 1 | R$990.00 | R$792.00 |
| PEDAGOGIA | 5 | R$383.27 | R$327.87 |
| PROCESSOS GERENCIAIS | 3 | R$574.48 | R$438.64 |
| PSICOLOGIA | 4 | R$1278.33 | R$755.35 |
| QUÍMICA | 1 | R$715.00 | R$643.00 |
| RADIOLOGIA | 1 | R$657.00 | R$525.60 |
| REDES DE COMPUTADORES | 3 | R$506.82 | R$377.37 |
| SEGURANÇA PÚBLICA | 1 | R$437.00 | R$228.50 |
| SERVIÇO SOCIAL | 2 | R$801.54 | R$541.56 |
| SISTEMAS BIOMÉDICOS | 1 | R$406.67 | R$406.67 |
| SISTEMAS DE INFORMAÇÃO | 1 | R$1175.00 | R$705.00 |