Sistema de Informações Gerenciais do Interlegis
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2265 lines
87 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<script>requirejs.config({paths: { 'plotly': ['https://cdn.plot.ly/plotly-latest.min']},});if(!window.Plotly) {{require(['plotly'],function(plotly) {window.Plotly=plotly;});}}</script>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"<style>body {\n",
" margin: 0;\n",
" font-family: Helvetica;\n",
"}\n",
"table.dataframe {\n",
" border-collapse: collapse;\n",
" border: none;\n",
"}\n",
"table.dataframe tr {\n",
" border: none;\n",
"}\n",
"table.dataframe td, table.dataframe th {\n",
" margin: 0;\n",
" border: 1px solid white;\n",
" padding-left: 0.25em;\n",
" padding-right: 0.25em;\n",
"}\n",
"table.dataframe th:not(:empty) {\n",
" background-color: #fec;\n",
" text-align: left;\n",
" font-weight: normal;\n",
"}\n",
"table.dataframe tr:nth-child(2) th:empty {\n",
" border-left: none;\n",
" border-right: 1px dashed #888;\n",
"}\n",
"table.dataframe td {\n",
" border: 2px solid #ccf;\n",
" background-color: #f4f4ff;\n",
"}\n",
"h3 {\n",
" color: white;\n",
" background-color: black;\n",
" padding: 0.5em;\n",
"}\n",
"</style>"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Plots'offline and notebook's style configs\n",
"from IPython.core.display import HTML\n",
"from sigi.apps.servicos.models import Servico\n",
"from django.db import connection\n",
"from django.core.urlresolvers import reverse\n",
"from django.db.models import Q, Count\n",
"from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot\n",
"import plotly \n",
"import plotly.plotly as py\n",
"import plotly.graph_objs as go\n",
"import pandas as pd\n",
"import cufflinks as cf\n",
"import numpy as np\n",
"import datetime\n",
"import calendar\n",
"\n",
"init_notebook_mode(connected=True)\n",
"css = open('style-table.css').read() + open('style-notebook.css').read()\n",
"HTML('<style>{}</style>'.format(css))"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"''' Function defined on sigi/sigi/sigi/apps/home/views.py line 322 to line 364\n",
" All rights reserved.\n",
" Obs.: Added number of deactivated types of services per month/year.\n",
"'''\n",
"def busca_informacoes_seit(mes_atual=None):\n",
" if mes_atual is None:\n",
" mes_atual = datetime.date.today().replace(day=1)\n",
" mes_anterior = mes_atual - datetime.timedelta(days=1)\n",
" proximo_mes = mes_atual + datetime.timedelta(days=calendar.monthrange(mes_atual.year, mes_atual.month)[1])\n",
" \n",
" meses = []\n",
" mes = mes_atual\n",
" for i in range(1, 13):\n",
" meses.append(mes)\n",
" mes = (mes - datetime.timedelta(days=1)).replace(day=1)\n",
" \n",
" result = {\n",
" 'mes_atual': mes_atual,\n",
" 'mes_anterior': mes_anterior,\n",
" 'proximo_mes': proximo_mes,\n",
" 'servicos': [],\n",
" } \n",
"\n",
" for tipo_servico in TipoServico.objects.all():\n",
" result['servicos'].append(\n",
" {'nome': tipo_servico.nome,\n",
" 'total_desativados': tipo_servico.servico_set.filter(data_desativacao__year=mes_atual.year, data_desativacao__month=mes_atual.month).count(),\n",
" 'total': tipo_servico.servico_set.filter(Q(data_ativacao__lt=proximo_mes)&(Q(data_desativacao=None)|Q(data_desativacao__gt=proximo_mes))).count(),\n",
" 'novos_mes_anterior': tipo_servico.servico_set.filter(data_ativacao__year=mes_anterior.year, data_ativacao__month=mes_anterior.month).count(),\n",
" 'novos_mes_atual': tipo_servico.servico_set.filter(data_ativacao__year=mes_atual.year, data_ativacao__month=mes_atual.month).count(),\n",
" }\n",
" )\n",
"\n",
" return result"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Define periods for data frame's indexes and variables\n",
"di = pd.date_range('2008-11', periods=((datetime.date.today().year - datetime.date(2008,11, 30).year) * 12) - (12 - datetime.date.today().month - 2), freq='M')\n",
"period = {}\n",
"period_formated = []\n",
"tabela_resumo_seit = []\n",
"services_names = []\n",
"services_names = []\n",
"period['year'] = di.year\n",
"period['month'] = di.month\n",
"dataframe_data = []\n",
"# Build of the data frame's data as a dictionary\n",
"for i in range(0, len(period['year'])):\n",
" period_formated.append('{year}/{month}'.format(year = str(period['year'][i]), month = str(period['month'][i])))\n",
" try:\n",
" mes = datetime.date(year=period['year'][i], month=period['month'][i], day=1)\n",
" tabela_resumo_seit.append(busca_informacoes_seit(mes))\n",
" except:\n",
" tabela_resumo_seit.append(busca_informacoes_seit())"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Dominio.GOV.br(Ativados)</th>\n",
" <th>Dominio.GOV.br(Ativos)</th>\n",
" <th>Dominio.GOV.br(Desativados)</th>\n",
" <th>Dominio.Leg.br(Ativados)</th>\n",
" <th>Dominio.Leg.br(Ativos)</th>\n",
" <th>Dominio.Leg.br(Desativados)</th>\n",
" <th>PortalModelo(Ativados)</th>\n",
" <th>PortalModelo(Ativos)</th>\n",
" <th>PortalModelo(Desativados)</th>\n",
" <th>SAAP(Ativados)</th>\n",
" <th>SAAP(Ativos)</th>\n",
" <th>SAAP(Desativados)</th>\n",
" <th>SAPL(Ativados)</th>\n",
" <th>SAPL(Ativos)</th>\n",
" <th>SAPL(Desativados)</th>\n",
" <th>SPDO(Ativados)</th>\n",
" <th>SPDO(Ativos)</th>\n",
" <th>SPDO(Desativados)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2008/11</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2008/12</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/1</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>3</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/2</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>5</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/3</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>6</td>\n",
" <td>11</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/4</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>15</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/5</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>23</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/6</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>25</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/7</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>6</td>\n",
" <td>31</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/8</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>10</td>\n",
" <td>41</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/9</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>43</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/10</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>44</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/11</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>47</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2009/12</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>47</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/1</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>48</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/2</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>51</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/3</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>53</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/4</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>54</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/5</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>57</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/6</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>60</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/7</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>61</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/8</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>61</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/9</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>61</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>3</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/10</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>62</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>6</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/11</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>66</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>14</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2010/12</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>70</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>18</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011/1</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>73</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>20</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011/2</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>77</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>23</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011/3</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>80</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>28</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2011/4</th>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>81</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>29</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/3</th>\n",
" <td>1</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>13</td>\n",
" <td>551</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>457</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>28</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>374</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/4</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>11</td>\n",
" <td>562</td>\n",
" <td>0</td>\n",
" <td>11</td>\n",
" <td>468</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>28</td>\n",
" <td>0</td>\n",
" <td>12</td>\n",
" <td>386</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/5</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>566</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>473</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>28</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>390</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/6</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>567</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>476</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>28</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>390</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/7</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>572</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>480</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>29</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>390</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/8</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>10</td>\n",
" <td>582</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>488</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>29</td>\n",
" <td>0</td>\n",
" <td>7</td>\n",
" <td>397</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/9</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>583</td>\n",
" <td>0</td>\n",
" <td>132</td>\n",
" <td>620</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>29</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>402</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/10</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>50</td>\n",
" <td>633</td>\n",
" <td>0</td>\n",
" <td>65</td>\n",
" <td>683</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>30</td>\n",
" <td>0</td>\n",
" <td>7</td>\n",
" <td>409</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/11</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>220</td>\n",
" <td>853</td>\n",
" <td>0</td>\n",
" <td>66</td>\n",
" <td>747</td>\n",
" <td>2</td>\n",
" <td>0</td>\n",
" <td>30</td>\n",
" <td>0</td>\n",
" <td>31</td>\n",
" <td>439</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2014/12</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>27</td>\n",
" <td>880</td>\n",
" <td>0</td>\n",
" <td>28</td>\n",
" <td>775</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>32</td>\n",
" <td>0</td>\n",
" <td>17</td>\n",
" <td>455</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/1</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>41</td>\n",
" <td>921</td>\n",
" <td>0</td>\n",
" <td>38</td>\n",
" <td>811</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>33</td>\n",
" <td>0</td>\n",
" <td>10</td>\n",
" <td>464</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/2</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>53</td>\n",
" <td>974</td>\n",
" <td>0</td>\n",
" <td>61</td>\n",
" <td>871</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>33</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>471</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/3</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>34</td>\n",
" <td>1008</td>\n",
" <td>0</td>\n",
" <td>47</td>\n",
" <td>918</td>\n",
" <td>0</td>\n",
" <td>4</td>\n",
" <td>37</td>\n",
" <td>0</td>\n",
" <td>9</td>\n",
" <td>480</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/4</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>37</td>\n",
" <td>1045</td>\n",
" <td>0</td>\n",
" <td>54</td>\n",
" <td>969</td>\n",
" <td>3</td>\n",
" <td>0</td>\n",
" <td>37</td>\n",
" <td>0</td>\n",
" <td>21</td>\n",
" <td>500</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/5</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>53</td>\n",
" <td>1098</td>\n",
" <td>0</td>\n",
" <td>62</td>\n",
" <td>1029</td>\n",
" <td>2</td>\n",
" <td>2</td>\n",
" <td>39</td>\n",
" <td>0</td>\n",
" <td>40</td>\n",
" <td>540</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/6</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>36</td>\n",
" <td>1134</td>\n",
" <td>0</td>\n",
" <td>47</td>\n",
" <td>1075</td>\n",
" <td>1</td>\n",
" <td>2</td>\n",
" <td>41</td>\n",
" <td>0</td>\n",
" <td>41</td>\n",
" <td>581</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/7</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>17</td>\n",
" <td>1151</td>\n",
" <td>0</td>\n",
" <td>22</td>\n",
" <td>1095</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>42</td>\n",
" <td>0</td>\n",
" <td>15</td>\n",
" <td>596</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/8</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>105</td>\n",
" <td>1256</td>\n",
" <td>0</td>\n",
" <td>114</td>\n",
" <td>1205</td>\n",
" <td>4</td>\n",
" <td>1</td>\n",
" <td>43</td>\n",
" <td>0</td>\n",
" <td>37</td>\n",
" <td>633</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/9</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>42</td>\n",
" <td>1297</td>\n",
" <td>1</td>\n",
" <td>33</td>\n",
" <td>1238</td>\n",
" <td>0</td>\n",
" <td>5</td>\n",
" <td>48</td>\n",
" <td>0</td>\n",
" <td>17</td>\n",
" <td>650</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/10</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>62</td>\n",
" <td>1358</td>\n",
" <td>1</td>\n",
" <td>62</td>\n",
" <td>1299</td>\n",
" <td>1</td>\n",
" <td>3</td>\n",
" <td>51</td>\n",
" <td>0</td>\n",
" <td>19</td>\n",
" <td>669</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/11</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>41</td>\n",
" <td>1399</td>\n",
" <td>0</td>\n",
" <td>28</td>\n",
" <td>1327</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>53</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>677</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2015/12</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>17</td>\n",
" <td>1415</td>\n",
" <td>1</td>\n",
" <td>15</td>\n",
" <td>1339</td>\n",
" <td>3</td>\n",
" <td>1</td>\n",
" <td>54</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>685</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/1</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>15</td>\n",
" <td>1430</td>\n",
" <td>0</td>\n",
" <td>15</td>\n",
" <td>1353</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>55</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>687</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/2</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>23</td>\n",
" <td>1453</td>\n",
" <td>0</td>\n",
" <td>22</td>\n",
" <td>1374</td>\n",
" <td>1</td>\n",
" <td>1</td>\n",
" <td>56</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>695</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/3</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>28</td>\n",
" <td>1481</td>\n",
" <td>0</td>\n",
" <td>27</td>\n",
" <td>1398</td>\n",
" <td>3</td>\n",
" <td>1</td>\n",
" <td>57</td>\n",
" <td>0</td>\n",
" <td>8</td>\n",
" <td>703</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/4</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>21</td>\n",
" <td>1501</td>\n",
" <td>1</td>\n",
" <td>16</td>\n",
" <td>1412</td>\n",
" <td>2</td>\n",
" <td>1</td>\n",
" <td>58</td>\n",
" <td>0</td>\n",
" <td>10</td>\n",
" <td>712</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/5</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>32</td>\n",
" <td>1533</td>\n",
" <td>0</td>\n",
" <td>21</td>\n",
" <td>1433</td>\n",
" <td>0</td>\n",
" <td>1</td>\n",
" <td>59</td>\n",
" <td>0</td>\n",
" <td>85</td>\n",
" <td>797</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/6</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>44</td>\n",
" <td>1576</td>\n",
" <td>1</td>\n",
" <td>28</td>\n",
" <td>1460</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>59</td>\n",
" <td>0</td>\n",
" <td>13</td>\n",
" <td>810</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/7</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>31</td>\n",
" <td>1607</td>\n",
" <td>0</td>\n",
" <td>37</td>\n",
" <td>1497</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>59</td>\n",
" <td>0</td>\n",
" <td>30</td>\n",
" <td>840</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2016/8</th>\n",
" <td>0</td>\n",
" <td>140</td>\n",
" <td>0</td>\n",
" <td>3</td>\n",
" <td>1610</td>\n",
" <td>0</td>\n",
" <td>2</td>\n",
" <td>1498</td>\n",
" <td>1</td>\n",
" <td>0</td>\n",
" <td>59</td>\n",
" <td>0</td>\n",
" <td>9</td>\n",
" <td>849</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" <td>0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>94 rows × 18 columns</p>\n",
"</div>"
],
"text/plain": [
" Dominio.GOV.br(Ativados) Dominio.GOV.br(Ativos) \\\n",
"2008/11 0 0 \n",
"2008/12 0 0 \n",
"2009/1 0 0 \n",
"2009/2 0 0 \n",
"2009/3 0 0 \n",
"2009/4 0 0 \n",
"2009/5 0 0 \n",
"2009/6 0 0 \n",
"2009/7 0 0 \n",
"2009/8 0 0 \n",
"2009/9 0 0 \n",
"2009/10 0 0 \n",
"2009/11 0 0 \n",
"2009/12 0 0 \n",
"2010/1 0 0 \n",
"2010/2 0 0 \n",
"2010/3 0 0 \n",
"2010/4 0 0 \n",
"2010/5 0 0 \n",
"2010/6 0 0 \n",
"2010/7 0 0 \n",
"2010/8 0 0 \n",
"2010/9 0 0 \n",
"2010/10 0 0 \n",
"2010/11 0 0 \n",
"2010/12 0 0 \n",
"2011/1 0 0 \n",
"2011/2 0 0 \n",
"2011/3 0 0 \n",
"2011/4 0 0 \n",
"... ... ... \n",
"2014/3 1 140 \n",
"2014/4 0 140 \n",
"2014/5 0 140 \n",
"2014/6 0 140 \n",
"2014/7 0 140 \n",
"2014/8 0 140 \n",
"2014/9 0 140 \n",
"2014/10 0 140 \n",
"2014/11 0 140 \n",
"2014/12 0 140 \n",
"2015/1 0 140 \n",
"2015/2 0 140 \n",
"2015/3 0 140 \n",
"2015/4 0 140 \n",
"2015/5 0 140 \n",
"2015/6 0 140 \n",
"2015/7 0 140 \n",
"2015/8 0 140 \n",
"2015/9 0 140 \n",
"2015/10 0 140 \n",
"2015/11 0 140 \n",
"2015/12 0 140 \n",
"2016/1 0 140 \n",
"2016/2 0 140 \n",
"2016/3 0 140 \n",
"2016/4 0 140 \n",
"2016/5 0 140 \n",
"2016/6 0 140 \n",
"2016/7 0 140 \n",
"2016/8 0 140 \n",
"\n",
" Dominio.GOV.br(Desativados) Dominio.Leg.br(Ativados) \\\n",
"2008/11 0 0 \n",
"2008/12 0 0 \n",
"2009/1 0 0 \n",
"2009/2 0 0 \n",
"2009/3 0 0 \n",
"2009/4 0 0 \n",
"2009/5 0 0 \n",
"2009/6 0 0 \n",
"2009/7 0 0 \n",
"2009/8 0 0 \n",
"2009/9 0 0 \n",
"2009/10 0 0 \n",
"2009/11 0 0 \n",
"2009/12 0 0 \n",
"2010/1 0 0 \n",
"2010/2 0 0 \n",
"2010/3 0 0 \n",
"2010/4 0 0 \n",
"2010/5 0 0 \n",
"2010/6 0 0 \n",
"2010/7 0 0 \n",
"2010/8 0 0 \n",
"2010/9 0 0 \n",
"2010/10 0 0 \n",
"2010/11 0 0 \n",
"2010/12 0 0 \n",
"2011/1 0 0 \n",
"2011/2 0 0 \n",
"2011/3 0 0 \n",
"2011/4 0 0 \n",
"... ... ... \n",
"2014/3 0 13 \n",
"2014/4 0 11 \n",
"2014/5 0 4 \n",
"2014/6 0 1 \n",
"2014/7 0 5 \n",
"2014/8 0 10 \n",
"2014/9 0 1 \n",
"2014/10 0 50 \n",
"2014/11 0 220 \n",
"2014/12 0 27 \n",
"2015/1 0 41 \n",
"2015/2 0 53 \n",
"2015/3 0 34 \n",
"2015/4 0 37 \n",
"2015/5 0 53 \n",
"2015/6 0 36 \n",
"2015/7 0 17 \n",
"2015/8 0 105 \n",
"2015/9 0 42 \n",
"2015/10 0 62 \n",
"2015/11 0 41 \n",
"2015/12 0 17 \n",
"2016/1 0 15 \n",
"2016/2 0 23 \n",
"2016/3 0 28 \n",
"2016/4 0 21 \n",
"2016/5 0 32 \n",
"2016/6 0 44 \n",
"2016/7 0 31 \n",
"2016/8 0 3 \n",
"\n",
" Dominio.Leg.br(Ativos) Dominio.Leg.br(Desativados) \\\n",
"2008/11 0 0 \n",
"2008/12 0 0 \n",
"2009/1 0 0 \n",
"2009/2 0 0 \n",
"2009/3 0 0 \n",
"2009/4 0 0 \n",
"2009/5 0 0 \n",
"2009/6 0 0 \n",
"2009/7 0 0 \n",
"2009/8 0 0 \n",
"2009/9 0 0 \n",
"2009/10 0 0 \n",
"2009/11 0 0 \n",
"2009/12 0 0 \n",
"2010/1 0 0 \n",
"2010/2 0 0 \n",
"2010/3 0 0 \n",
"2010/4 0 0 \n",
"2010/5 0 0 \n",
"2010/6 0 0 \n",
"2010/7 0 0 \n",
"2010/8 0 0 \n",
"2010/9 0 0 \n",
"2010/10 0 0 \n",
"2010/11 0 0 \n",
"2010/12 0 0 \n",
"2011/1 0 0 \n",
"2011/2 0 0 \n",
"2011/3 0 0 \n",
"2011/4 0 0 \n",
"... ... ... \n",
"2014/3 551 0 \n",
"2014/4 562 0 \n",
"2014/5 566 0 \n",
"2014/6 567 0 \n",
"2014/7 572 0 \n",
"2014/8 582 0 \n",
"2014/9 583 0 \n",
"2014/10 633 0 \n",
"2014/11 853 0 \n",
"2014/12 880 0 \n",
"2015/1 921 0 \n",
"2015/2 974 0 \n",
"2015/3 1008 0 \n",
"2015/4 1045 0 \n",
"2015/5 1098 0 \n",
"2015/6 1134 0 \n",
"2015/7 1151 0 \n",
"2015/8 1256 0 \n",
"2015/9 1297 1 \n",
"2015/10 1358 1 \n",
"2015/11 1399 0 \n",
"2015/12 1415 1 \n",
"2016/1 1430 0 \n",
"2016/2 1453 0 \n",
"2016/3 1481 0 \n",
"2016/4 1501 1 \n",
"2016/5 1533 0 \n",
"2016/6 1576 1 \n",
"2016/7 1607 0 \n",
"2016/8 1610 0 \n",
"\n",
" PortalModelo(Ativados) PortalModelo(Ativos) \\\n",
"2008/11 1 1 \n",
"2008/12 0 1 \n",
"2009/1 2 3 \n",
"2009/2 2 5 \n",
"2009/3 6 11 \n",
"2009/4 4 15 \n",
"2009/5 8 23 \n",
"2009/6 2 25 \n",
"2009/7 6 31 \n",
"2009/8 10 41 \n",
"2009/9 2 43 \n",
"2009/10 1 44 \n",
"2009/11 3 47 \n",
"2009/12 0 47 \n",
"2010/1 1 48 \n",
"2010/2 3 51 \n",
"2010/3 2 53 \n",
"2010/4 1 54 \n",
"2010/5 3 57 \n",
"2010/6 3 60 \n",
"2010/7 1 61 \n",
"2010/8 0 61 \n",
"2010/9 0 61 \n",
"2010/10 1 62 \n",
"2010/11 4 66 \n",
"2010/12 4 70 \n",
"2011/1 3 73 \n",
"2011/2 4 77 \n",
"2011/3 3 80 \n",
"2011/4 1 81 \n",
"... ... ... \n",
"2014/3 8 457 \n",
"2014/4 11 468 \n",
"2014/5 5 473 \n",
"2014/6 3 476 \n",
"2014/7 4 480 \n",
"2014/8 8 488 \n",
"2014/9 132 620 \n",
"2014/10 65 683 \n",
"2014/11 66 747 \n",
"2014/12 28 775 \n",
"2015/1 38 811 \n",
"2015/2 61 871 \n",
"2015/3 47 918 \n",
"2015/4 54 969 \n",
"2015/5 62 1029 \n",
"2015/6 47 1075 \n",
"2015/7 22 1095 \n",
"2015/8 114 1205 \n",
"2015/9 33 1238 \n",
"2015/10 62 1299 \n",
"2015/11 28 1327 \n",
"2015/12 15 1339 \n",
"2016/1 15 1353 \n",
"2016/2 22 1374 \n",
"2016/3 27 1398 \n",
"2016/4 16 1412 \n",
"2016/5 21 1433 \n",
"2016/6 28 1460 \n",
"2016/7 37 1497 \n",
"2016/8 2 1498 \n",
"\n",
" PortalModelo(Desativados) SAAP(Ativados) SAAP(Ativos) \\\n",
"2008/11 0 0 0 \n",
"2008/12 0 0 0 \n",
"2009/1 0 0 0 \n",
"2009/2 0 0 0 \n",
"2009/3 0 0 0 \n",
"2009/4 0 0 0 \n",
"2009/5 0 0 0 \n",
"2009/6 0 0 0 \n",
"2009/7 0 0 0 \n",
"2009/8 0 0 0 \n",
"2009/9 0 0 0 \n",
"2009/10 0 0 0 \n",
"2009/11 0 0 0 \n",
"2009/12 0 0 0 \n",
"2010/1 0 0 0 \n",
"2010/2 0 0 0 \n",
"2010/3 0 0 0 \n",
"2010/4 0 0 0 \n",
"2010/5 0 0 0 \n",
"2010/6 0 0 0 \n",
"2010/7 0 0 0 \n",
"2010/8 0 0 0 \n",
"2010/9 0 0 0 \n",
"2010/10 0 0 0 \n",
"2010/11 0 0 0 \n",
"2010/12 0 0 0 \n",
"2011/1 0 0 0 \n",
"2011/2 0 0 0 \n",
"2011/3 0 0 0 \n",
"2011/4 0 0 0 \n",
"... ... ... ... \n",
"2014/3 0 1 28 \n",
"2014/4 0 0 28 \n",
"2014/5 0 0 28 \n",
"2014/6 0 0 28 \n",
"2014/7 0 1 29 \n",
"2014/8 0 0 29 \n",
"2014/9 0 0 29 \n",
"2014/10 2 1 30 \n",
"2014/11 2 0 30 \n",
"2014/12 0 2 32 \n",
"2015/1 2 1 33 \n",
"2015/2 1 0 33 \n",
"2015/3 0 4 37 \n",
"2015/4 3 0 37 \n",
"2015/5 2 2 39 \n",
"2015/6 1 2 41 \n",
"2015/7 2 1 42 \n",
"2015/8 4 1 43 \n",
"2015/9 0 5 48 \n",
"2015/10 1 3 51 \n",
"2015/11 0 2 53 \n",
"2015/12 3 1 54 \n",
"2016/1 1 1 55 \n",
"2016/2 1 1 56 \n",
"2016/3 3 1 57 \n",
"2016/4 2 1 58 \n",
"2016/5 0 1 59 \n",
"2016/6 1 0 59 \n",
"2016/7 0 0 59 \n",
"2016/8 1 0 59 \n",
"\n",
" SAAP(Desativados) SAPL(Ativados) SAPL(Ativos) SAPL(Desativados) \\\n",
"2008/11 0 0 0 0 \n",
"2008/12 0 0 0 0 \n",
"2009/1 0 0 0 0 \n",
"2009/2 0 0 0 0 \n",
"2009/3 0 0 0 0 \n",
"2009/4 0 0 0 0 \n",
"2009/5 0 0 0 0 \n",
"2009/6 0 0 0 0 \n",
"2009/7 0 0 0 0 \n",
"2009/8 0 0 0 0 \n",
"2009/9 0 0 0 0 \n",
"2009/10 0 0 0 0 \n",
"2009/11 0 0 0 0 \n",
"2009/12 0 0 0 0 \n",
"2010/1 0 0 0 0 \n",
"2010/2 0 0 0 0 \n",
"2010/3 0 0 0 0 \n",
"2010/4 0 0 0 0 \n",
"2010/5 0 0 0 0 \n",
"2010/6 0 0 0 0 \n",
"2010/7 0 0 0 0 \n",
"2010/8 0 0 0 0 \n",
"2010/9 0 3 3 0 \n",
"2010/10 0 3 6 0 \n",
"2010/11 0 8 14 0 \n",
"2010/12 0 4 18 0 \n",
"2011/1 0 2 20 0 \n",
"2011/2 0 3 23 0 \n",
"2011/3 0 5 28 0 \n",
"2011/4 0 1 29 0 \n",
"... ... ... ... ... \n",
"2014/3 0 5 374 0 \n",
"2014/4 0 12 386 0 \n",
"2014/5 0 4 390 0 \n",
"2014/6 0 0 390 0 \n",
"2014/7 0 0 390 0 \n",
"2014/8 0 7 397 0 \n",
"2014/9 0 5 402 0 \n",
"2014/10 0 7 409 0 \n",
"2014/11 0 31 439 1 \n",
"2014/12 0 17 455 1 \n",
"2015/1 0 10 464 1 \n",
"2015/2 0 8 471 1 \n",
"2015/3 0 9 480 0 \n",
"2015/4 0 21 500 1 \n",
"2015/5 0 40 540 0 \n",
"2015/6 0 41 581 0 \n",
"2015/7 0 15 596 0 \n",
"2015/8 0 37 633 0 \n",
"2015/9 0 17 650 0 \n",
"2015/10 0 19 669 0 \n",
"2015/11 0 8 677 0 \n",
"2015/12 0 8 685 0 \n",
"2016/1 0 2 687 0 \n",
"2016/2 0 8 695 0 \n",
"2016/3 0 8 703 0 \n",
"2016/4 0 10 712 1 \n",
"2016/5 0 85 797 0 \n",
"2016/6 0 13 810 0 \n",
"2016/7 0 30 840 0 \n",
"2016/8 0 9 849 0 \n",
"\n",
" SPDO(Ativados) SPDO(Ativos) SPDO(Desativados) \n",
"2008/11 0 0 0 \n",
"2008/12 0 0 0 \n",
"2009/1 0 0 0 \n",
"2009/2 0 0 0 \n",
"2009/3 0 0 0 \n",
"2009/4 0 0 0 \n",
"2009/5 0 0 0 \n",
"2009/6 0 0 0 \n",
"2009/7 0 0 0 \n",
"2009/8 0 0 0 \n",
"2009/9 0 0 0 \n",
"2009/10 0 0 0 \n",
"2009/11 0 0 0 \n",
"2009/12 0 0 0 \n",
"2010/1 0 0 0 \n",
"2010/2 0 0 0 \n",
"2010/3 0 0 0 \n",
"2010/4 0 0 0 \n",
"2010/5 0 0 0 \n",
"2010/6 0 0 0 \n",
"2010/7 0 0 0 \n",
"2010/8 0 0 0 \n",
"2010/9 0 0 0 \n",
"2010/10 0 0 0 \n",
"2010/11 0 0 0 \n",
"2010/12 0 0 0 \n",
"2011/1 0 0 0 \n",
"2011/2 0 0 0 \n",
"2011/3 0 0 0 \n",
"2011/4 0 0 0 \n",
"... ... ... ... \n",
"2014/3 0 0 0 \n",
"2014/4 0 0 0 \n",
"2014/5 0 0 0 \n",
"2014/6 0 0 0 \n",
"2014/7 0 0 0 \n",
"2014/8 0 0 0 \n",
"2014/9 0 0 0 \n",
"2014/10 0 0 0 \n",
"2014/11 0 0 0 \n",
"2014/12 0 0 0 \n",
"2015/1 0 0 0 \n",
"2015/2 0 0 0 \n",
"2015/3 0 0 0 \n",
"2015/4 0 0 0 \n",
"2015/5 0 0 0 \n",
"2015/6 0 0 0 \n",
"2015/7 0 0 0 \n",
"2015/8 0 0 0 \n",
"2015/9 0 0 0 \n",
"2015/10 0 0 0 \n",
"2015/11 0 0 0 \n",
"2015/12 0 0 0 \n",
"2016/1 0 0 0 \n",
"2016/2 0 0 0 \n",
"2016/3 0 0 0 \n",
"2016/4 0 0 0 \n",
"2016/5 0 0 0 \n",
"2016/6 0 0 0 \n",
"2016/7 0 0 0 \n",
"2016/8 0 0 0 \n",
"\n",
"[94 rows x 18 columns]"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Build list of desired values into tabela_resumo_seit\n",
"ativados_temp = []\n",
"ativados = []\n",
"desativados_temp = []\n",
"desativados = []\n",
"ativos_temp = []\n",
"ativos = []\n",
"\n",
"for i in range(0, len(period['year'])):\n",
" for j in range (0,6):\n",
" ativados_temp.append(tabela_resumo_seit[i]['servicos'][j]['novos_mes_atual'])\n",
" desativados_temp.append(tabela_resumo_seit[i]['servicos'][j]['total_desativados'])\n",
" ativos_temp.append(tabela_resumo_seit[i]['servicos'][j]['total'])\n",
"\n",
"# Create an iterator\n",
"it = [iter(ativados_temp)] * 6 \n",
"# Unpack the copies of the iterator, and pass them as parameters to zip\n",
"ativados = zip(*it)\n",
"# Create an iterator\n",
"it2 = [iter(desativados_temp)] * 6 \n",
"# Unpack the copies of the iterator, and pass them as parameters to zip\n",
"desativados = zip(*it2)\n",
"# Create an iterator\n",
"it3 = [iter(ativos_temp)] * 6 \n",
"# Unpack the copies of the iterator, and pass them as parameters to zip\n",
"ativos = zip(*it3)\n",
" \n",
"# Creation of the data frame\n",
"df_final = pd.DataFrame(ativados, index=period_formated, columns=['PortalModelo(Ativados)', 'SAPL(Ativados)', 'SAAP(Ativados)', 'SPDO(Ativados)', 'Dominio.Leg.br(Ativados)', 'Dominio.GOV.br(Ativados)'])\n",
"df_desativados = pd.DataFrame(desativados, index=period_formated, columns=['PortalModelo(Desativados)', 'SAPL(Desativados)', 'SAAP(Desativados)', 'SPDO(Desativados)', 'Dominio.Leg.br(Desativados)', 'Dominio.GOV.br(Desativados)'])\n",
"df_ativos = pd.DataFrame(ativos, index=period_formated, columns=['PortalModelo(Ativos)', 'SAPL(Ativos)', 'SAAP(Ativos)', 'SPDO(Ativos)', 'Dominio.Leg.br(Ativos)', 'Dominio.GOV.br(Ativos)'])\n",
"\n",
"df_final['PortalModelo(Desativados)'] = df_desativados['PortalModelo(Desativados)']\n",
"df_final['SAPL(Desativados)'] = df_desativados['SAPL(Desativados)']\n",
"df_final['SAAP(Desativados)'] = df_desativados['SAAP(Desativados)']\n",
"df_final['SPDO(Desativados)'] = df_desativados['SPDO(Desativados)']\n",
"df_final['Dominio.Leg.br(Desativados)'] = df_desativados['Dominio.Leg.br(Desativados)']\n",
"df_final['Dominio.GOV.br(Desativados)'] = df_desativados['Dominio.GOV.br(Desativados)']\n",
"\n",
"df_final['PortalModelo(Ativos)'] = df_ativos['PortalModelo(Ativos)']\n",
"df_final['SAPL(Ativos)'] = df_ativos['SAPL(Ativos)']\n",
"df_final['SAAP(Ativos)'] = df_ativos['SAAP(Ativos)']\n",
"df_final['SPDO(Ativos)'] = df_ativos['SPDO(Ativos)']\n",
"df_final['Dominio.Leg.br(Ativos)'] = df_ativos['Dominio.Leg.br(Ativos)']\n",
"df_final['Dominio.GOV.br(Ativos)'] = df_ativos['Dominio.GOV.br(Ativos)']\n",
"\n",
"cols = df_final.columns.tolist()\n",
"\n",
"cols.sort()\n",
"\n",
"df_final = df_final[cols]\n",
"\n",
"df_final\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Total</th>\n",
" <th>TipoServico</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Dominio.GOV.br(Ativados)</th>\n",
" <td>160</td>\n",
" <td>Dominio.GOV.br(Ativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Dominio.GOV.br(Ativos)</th>\n",
" <td>5957</td>\n",
" <td>Dominio.GOV.br(Ativos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Dominio.GOV.br(Desativados)</th>\n",
" <td>20</td>\n",
" <td>Dominio.GOV.br(Desativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Dominio.Leg.br(Ativados)</th>\n",
" <td>1615</td>\n",
" <td>Dominio.Leg.br(Ativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Dominio.Leg.br(Ativos)</th>\n",
" <td>38918</td>\n",
" <td>Dominio.Leg.br(Ativos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Dominio.Leg.br(Desativados)</th>\n",
" <td>5</td>\n",
" <td>Dominio.Leg.br(Desativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PortalModelo(Ativados)</th>\n",
" <td>1547</td>\n",
" <td>PortalModelo(Ativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PortalModelo(Ativos)</th>\n",
" <td>41070</td>\n",
" <td>PortalModelo(Ativos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PortalModelo(Desativados)</th>\n",
" <td>49</td>\n",
" <td>PortalModelo(Desativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAAP(Ativados)</th>\n",
" <td>59</td>\n",
" <td>SAAP(Ativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAAP(Ativos)</th>\n",
" <td>1486</td>\n",
" <td>SAAP(Ativos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAAP(Desativados)</th>\n",
" <td>0</td>\n",
" <td>SAAP(Desativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAPL(Ativados)</th>\n",
" <td>855</td>\n",
" <td>SAPL(Ativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAPL(Ativos)</th>\n",
" <td>24105</td>\n",
" <td>SAPL(Ativos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SAPL(Desativados)</th>\n",
" <td>6</td>\n",
" <td>SAPL(Desativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SPDO(Ativados)</th>\n",
" <td>0</td>\n",
" <td>SPDO(Ativados)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SPDO(Ativos)</th>\n",
" <td>0</td>\n",
" <td>SPDO(Ativos)</td>\n",
" </tr>\n",
" <tr>\n",
" <th>SPDO(Desativados)</th>\n",
" <td>0</td>\n",
" <td>SPDO(Desativados)</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Total TipoServico\n",
"Dominio.GOV.br(Ativados) 160 Dominio.GOV.br(Ativados)\n",
"Dominio.GOV.br(Ativos) 5957 Dominio.GOV.br(Ativos)\n",
"Dominio.GOV.br(Desativados) 20 Dominio.GOV.br(Desativados)\n",
"Dominio.Leg.br(Ativados) 1615 Dominio.Leg.br(Ativados)\n",
"Dominio.Leg.br(Ativos) 38918 Dominio.Leg.br(Ativos)\n",
"Dominio.Leg.br(Desativados) 5 Dominio.Leg.br(Desativados)\n",
"PortalModelo(Ativados) 1547 PortalModelo(Ativados)\n",
"PortalModelo(Ativos) 41070 PortalModelo(Ativos)\n",
"PortalModelo(Desativados) 49 PortalModelo(Desativados)\n",
"SAAP(Ativados) 59 SAAP(Ativados)\n",
"SAAP(Ativos) 1486 SAAP(Ativos)\n",
"SAAP(Desativados) 0 SAAP(Desativados)\n",
"SAPL(Ativados) 855 SAPL(Ativados)\n",
"SAPL(Ativos) 24105 SAPL(Ativos)\n",
"SAPL(Desativados) 6 SAPL(Desativados)\n",
"SPDO(Ativados) 0 SPDO(Ativados)\n",
"SPDO(Ativos) 0 SPDO(Ativos)\n",
"SPDO(Desativados) 0 SPDO(Desativados)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_stats = pd.DataFrame(df_final.loc[:,:].sum(numeric_only=True), columns=['Total'])\n",
"df_stats['TipoServico'] = df_final.columns[:]\n",
"\n",
"df_stats"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~swallville/202.embed\" height=\"525px\" width=\"100%\"></iframe>"
],
"text/plain": [
"<plotly.tools.PlotlyDisplay object>"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Obs.: Layout dos plots sao normalmente configurados como\n",
"# dicionarios e encapsulados pela func. abaixo\n",
"layout = go.Layout(\n",
" title='Detalhamento do Programa Interlegis',\n",
" xaxis=dict(\n",
" title='Periodo',\n",
" titlefont=dict(\n",
" family='Courier New, monospace',\n",
" size=18,\n",
" color='#7f7f7f'\n",
" )\n",
" ),\n",
" yaxis=dict(\n",
" title='Quantidade',\n",
" titlefont=dict(\n",
" family='Courier New, monospace',\n",
" size=18,\n",
" color='#7f7f7f'\n",
" )\n",
" )\n",
")\n",
"\n",
"py.iplot(dict(data = [{\n",
" 'x': df_final.index,\n",
" 'y': df_final[col],\n",
" 'name': col\n",
"} for col in df_final.columns[:]], layout = layout), kind='scatter', asFigure=True)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<iframe id=\"igraph\" scrolling=\"no\" style=\"border:none;\" seamless=\"seamless\" src=\"https://plot.ly/~swallville/195.embed\" height=\"525px\" width=\"100%\"></iframe>"
],
"text/plain": [
"<plotly.tools.PlotlyDisplay object>"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Kind = tipo de plot; labels = nome dos valores; values = os valores a serem colocados no plot;\n",
"df_stats.iplot(kind='pie', labels='TipoServico', values='Total', pull=.1, hole=.1,\n",
" colorscale='blues', textposition='outside', textinfo='value+percent', title='Detalhamento do Programa Interlegis')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Obs.: Usar sudo pip install XlsxWriter no seu Virtualenv\n",
"writer = pd.ExcelWriter('output.xlsx', engine='xlsxwriter')\n",
"df_final.loc[:,:].to_excel(writer,'Sheet1')\n",
"df_stats.to_excel(writer,'Sheet2')\n",
"writer.save()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Django Shell-Plus",
"language": "python",
"name": "django_extensions"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 1
}