-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTreinando com Google Colab
1 lines (1 loc) · 42.1 KB
/
Treinando com Google Colab
1
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyOAHKdewBIRns4OW8l6be1q"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":null,"metadata":{"id":"vmDSpjSj5RSV"},"outputs":[],"source":["import pandas as pd\n"]},{"cell_type":"markdown","source":["###Series"],"metadata":{"id":"jfbLGzTi5g4I"}},{"cell_type":"code","source":["numero_lista = [2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 56, 78]"],"metadata":{"id":"ttcHYEgG5Ya-"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["mediana_lista = pd.Series(numero_lista).median()\n","mediana_lista"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"JJSYyhwA5o-8","executionInfo":{"status":"ok","timestamp":1690470732501,"user_tz":180,"elapsed":290,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"3045f6f1-6ce3-4f30-cb98-a563593ad904"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["7.5"]},"metadata":{},"execution_count":10}]},{"cell_type":"code","source":["soma_lista = pd.Series(numero_lista).sum()\n","print('Soma da lista:', soma_lista)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"cQcOgogD6Fvp","executionInfo":{"status":"ok","timestamp":1690470792257,"user_tz":180,"elapsed":283,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"d4ac0cf2-4419-4068-c2a1-616dccbdcb48"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":["Soma da lista: 211\n"]}]},{"cell_type":"code","source":["desvio_lista = pd.Series(numero_lista).std()\n","desvio_lista"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"fwG6XCYG6VHg","executionInfo":{"status":"ok","timestamp":1690470829702,"user_tz":180,"elapsed":254,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"352302c9-72c8-4886-93b6-11dece8d3db4"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["24.164054195261095"]},"metadata":{},"execution_count":12}]},{"cell_type":"markdown","source":["###DataFrames"],"metadata":{"id":"hJRcqjpB7y-g"}},{"cell_type":"code","source":["import pandas as pd"],"metadata":{"id":"H4C23AQYgbOl"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["dados = [\n"," {'Nome': 'João', 'Idade': 25, 'Profissão': 'Engenheiro'},\n"," {'Nome': 'Maria', 'Idade': 30, 'Profissão': 'Médica'},\n"," {'Nome': 'Pedro', 'Idade': 22, 'Profissão': 'Estudante'},\n","]\n"],"metadata":{"id":"szQ7aLuF9PLe"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["df_teste = pd.DataFrame(dados)"],"metadata":{"id":"yXdNvVfcgP-h"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["df_teste.columns = ['Nome', 'Idade', 'Profissão']"],"metadata":{"id":"cmH7OV4ggoS_"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["df_teste"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":143},"id":"IA6vY43hg3r1","executionInfo":{"status":"ok","timestamp":1690480906319,"user_tz":180,"elapsed":232,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"610d598b-a4c8-4841-e291-1c4e920ce7a6"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" Nome Idade Profissão\n","0 João 25 Engenheiro\n","1 Maria 30 Médica\n","2 Pedro 22 Estudante"],"text/html":["\n","\n"," <div id=\"df-efec669d-aa77-41a6-8d7e-100edf7f7952\">\n"," <div class=\"colab-df-container\">\n"," <div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>Nome</th>\n"," <th>Idade</th>\n"," <th>Profissão</th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0</th>\n"," <td>João</td>\n"," <td>25</td>\n"," <td>Engenheiro</td>\n"," </tr>\n"," <tr>\n"," <th>1</th>\n"," <td>Maria</td>\n"," <td>30</td>\n"," <td>Médica</td>\n"," </tr>\n"," <tr>\n"," <th>2</th>\n"," <td>Pedro</td>\n"," <td>22</td>\n"," <td>Estudante</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>\n"," <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-efec669d-aa77-41a6-8d7e-100edf7f7952')\"\n"," title=\"Convert this dataframe to an interactive table.\"\n"," style=\"display:none;\">\n","\n"," <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n"," <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n"," </svg>\n"," </button>\n","\n","\n","\n"," <div id=\"df-3951a51c-1b18-4fa4-8935-8af9a859322c\">\n"," <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-3951a51c-1b18-4fa4-8935-8af9a859322c')\"\n"," title=\"Suggest charts.\"\n"," style=\"display:none;\">\n","\n","<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <g>\n"," <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n"," </g>\n","</svg>\n"," </button>\n"," </div>\n","\n","<style>\n"," .colab-df-quickchart {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-quickchart:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n","</style>\n","\n"," <script>\n"," async function quickchart(key) {\n"," const containerElement = document.querySelector('#' + key);\n"," const charts = await google.colab.kernel.invokeFunction(\n"," 'suggestCharts', [key], {});\n"," }\n"," </script>\n","\n"," <script>\n","\n","function displayQuickchartButton(domScope) {\n"," let quickchartButtonEl =\n"," domScope.querySelector('#df-3951a51c-1b18-4fa4-8935-8af9a859322c button.colab-df-quickchart');\n"," quickchartButtonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","}\n","\n"," displayQuickchartButton(document);\n"," </script>\n"," <style>\n"," .colab-df-container {\n"," display:flex;\n"," flex-wrap:wrap;\n"," gap: 12px;\n"," }\n","\n"," .colab-df-convert {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-convert:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-convert {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-convert:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n"," </style>\n","\n"," <script>\n"," const buttonEl =\n"," document.querySelector('#df-efec669d-aa77-41a6-8d7e-100edf7f7952 button.colab-df-convert');\n"," buttonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","\n"," async function convertToInteractive(key) {\n"," const element = document.querySelector('#df-efec669d-aa77-41a6-8d7e-100edf7f7952');\n"," const dataTable =\n"," await google.colab.kernel.invokeFunction('convertToInteractive',\n"," [key], {});\n"," if (!dataTable) return;\n","\n"," const docLinkHtml = 'Like what you see? Visit the ' +\n"," '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n"," + ' to learn more about interactive tables.';\n"," element.innerHTML = '';\n"," dataTable['output_type'] = 'display_data';\n"," await google.colab.output.renderOutput(dataTable, element);\n"," const docLink = document.createElement('div');\n"," docLink.innerHTML = docLinkHtml;\n"," element.appendChild(docLink);\n"," }\n"," </script>\n"," </div>\n"," </div>\n"]},"metadata":{},"execution_count":9}]},{"cell_type":"code","source":["df_teste[df_teste['Idade'] < 30]"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":112},"id":"FbzWIjeHg-yx","executionInfo":{"status":"ok","timestamp":1690480966370,"user_tz":180,"elapsed":224,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"a534c6e1-d4fb-4161-d465-6361cc90c623"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" Nome Idade Profissão\n","0 João 25 Engenheiro\n","2 Pedro 22 Estudante"],"text/html":["\n","\n"," <div id=\"df-4cef116e-1d9e-4922-8d86-067b8013d322\">\n"," <div class=\"colab-df-container\">\n"," <div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>Nome</th>\n"," <th>Idade</th>\n"," <th>Profissão</th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0</th>\n"," <td>João</td>\n"," <td>25</td>\n"," <td>Engenheiro</td>\n"," </tr>\n"," <tr>\n"," <th>2</th>\n"," <td>Pedro</td>\n"," <td>22</td>\n"," <td>Estudante</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>\n"," <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-4cef116e-1d9e-4922-8d86-067b8013d322')\"\n"," title=\"Convert this dataframe to an interactive table.\"\n"," style=\"display:none;\">\n","\n"," <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n"," <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n"," </svg>\n"," </button>\n","\n","\n","\n"," <div id=\"df-3b03a0fb-637c-4257-bc8f-17f00824d3ed\">\n"," <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-3b03a0fb-637c-4257-bc8f-17f00824d3ed')\"\n"," title=\"Suggest charts.\"\n"," style=\"display:none;\">\n","\n","<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <g>\n"," <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n"," </g>\n","</svg>\n"," </button>\n"," </div>\n","\n","<style>\n"," .colab-df-quickchart {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-quickchart:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n","</style>\n","\n"," <script>\n"," async function quickchart(key) {\n"," const containerElement = document.querySelector('#' + key);\n"," const charts = await google.colab.kernel.invokeFunction(\n"," 'suggestCharts', [key], {});\n"," }\n"," </script>\n","\n"," <script>\n","\n","function displayQuickchartButton(domScope) {\n"," let quickchartButtonEl =\n"," domScope.querySelector('#df-3b03a0fb-637c-4257-bc8f-17f00824d3ed button.colab-df-quickchart');\n"," quickchartButtonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","}\n","\n"," displayQuickchartButton(document);\n"," </script>\n"," <style>\n"," .colab-df-container {\n"," display:flex;\n"," flex-wrap:wrap;\n"," gap: 12px;\n"," }\n","\n"," .colab-df-convert {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-convert:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-convert {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-convert:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n"," </style>\n","\n"," <script>\n"," const buttonEl =\n"," document.querySelector('#df-4cef116e-1d9e-4922-8d86-067b8013d322 button.colab-df-convert');\n"," buttonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","\n"," async function convertToInteractive(key) {\n"," const element = document.querySelector('#df-4cef116e-1d9e-4922-8d86-067b8013d322');\n"," const dataTable =\n"," await google.colab.kernel.invokeFunction('convertToInteractive',\n"," [key], {});\n"," if (!dataTable) return;\n","\n"," const docLinkHtml = 'Like what you see? Visit the ' +\n"," '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n"," + ' to learn more about interactive tables.';\n"," element.innerHTML = '';\n"," dataTable['output_type'] = 'display_data';\n"," await google.colab.output.renderOutput(dataTable, element);\n"," const docLink = document.createElement('div');\n"," docLink.innerHTML = docLinkHtml;\n"," element.appendChild(docLink);\n"," }\n"," </script>\n"," </div>\n"," </div>\n"]},"metadata":{},"execution_count":10}]},{"cell_type":"code","source":["# modulos\n","from itertools import product, permutations, combinations, combinations_with_replacement\n","from math import factorial\n","import numpy as np\n","import pandas as pd\n","import datetime\n","import matplotlib.pyplot as plt\n","import seaborn as sns\n","from scipy.stats import binom, poisson, expon, norm\n"],"metadata":{"id":"IXR4OAAq8ABd","executionInfo":{"status":"ok","timestamp":1690806984277,"user_tz":180,"elapsed":2470,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":2,"outputs":[]},{"cell_type":"code","source":["dados1 = [\n"," {'preco_vinho_italiano' : 50, 'gasto_propaganda' : 230, 'temperatura' : 27, 'vendas_vinho_nacional' : 328},\n"," {'preco_vinho_italiano' : 50, 'gasto_propaganda' : 232, 'temperatura' : 26, 'vendas_vinho_nacional' : 328},\n"," {'preco_vinho_italiano' : 58, 'gasto_propaganda' : 235, 'temperatura' : 26, 'vendas_vinho_nacional' : 330},\n"," {'preco_vinho_italiano' : 56, 'gasto_propaganda' : 240, 'temperatura' : 25, 'vendas_vinho_nacional' : 335},\n"," {'preco_vinho_italiano' : 52, 'gasto_propaganda' : 242, 'temperatura' : 24, 'vendas_vinho_nacional' : 320},\n"," {'preco_vinho_italiano' : 55, 'gasto_propaganda' : 245, 'temperatura' : 26, 'vendas_vinho_nacional' : 325},\n"," {'preco_vinho_italiano' : 58, 'gasto_propaganda' : 232, 'temperatura' : 26, 'vendas_vinho_nacional' : 310},\n"," {'preco_vinho_italiano' : 68, 'gasto_propaganda' : 230, 'temperatura' : 26, 'vendas_vinho_nacional' : 340},\n"," {'preco_vinho_italiano' : 62, 'gasto_propaganda' : 228, 'temperatura' : 24, 'vendas_vinho_nacional' : 350},\n"," {'preco_vinho_italiano' : 78, 'gasto_propaganda' : 220, 'temperatura' : 26, 'vendas_vinho_nacional' : 360},\n"," {'preco_vinho_italiano' : 90, 'gasto_propaganda' : 200, 'temperatura' : 26, 'vendas_vinho_nacional' : 328},\n"," {'preco_vinho_italiano' : 40, 'gasto_propaganda' : 220, 'temperatura' : 26, 'vendas_vinho_nacional' : 320},\n"," {'preco_vinho_italiano' : 50, 'gasto_propaganda' : 226, 'temperatura' : 26, 'vendas_vinho_nacional' : 325},\n","]"],"metadata":{"id":"yHqdy5F2NRBH","executionInfo":{"status":"ok","timestamp":1690807180084,"user_tz":180,"elapsed":4,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":7,"outputs":[]},{"cell_type":"code","source":["dados_vinho = pd.DataFrame(dados1)\n","dados_vinho"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":457},"id":"zH-e7mw489Tm","executionInfo":{"status":"ok","timestamp":1690807184144,"user_tz":180,"elapsed":11,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"44813638-2adc-4c5f-d595-d41d5c6b330a"},"execution_count":8,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" preco_vinho_italiano gasto_propaganda temperatura vendas_vinho_nacional\n","0 50 230 27 328\n","1 50 232 26 328\n","2 58 235 26 330\n","3 56 240 25 335\n","4 52 242 24 320\n","5 55 245 26 325\n","6 58 232 26 310\n","7 68 230 26 340\n","8 62 228 24 350\n","9 78 220 26 360\n","10 90 200 26 328\n","11 40 220 26 320\n","12 50 226 26 325"],"text/html":["\n","\n"," <div id=\"df-3f8bf07f-2d33-4f80-9a73-0e8884ef2f07\">\n"," <div class=\"colab-df-container\">\n"," <div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>preco_vinho_italiano</th>\n"," <th>gasto_propaganda</th>\n"," <th>temperatura</th>\n"," <th>vendas_vinho_nacional</th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0</th>\n"," <td>50</td>\n"," <td>230</td>\n"," <td>27</td>\n"," <td>328</td>\n"," </tr>\n"," <tr>\n"," <th>1</th>\n"," <td>50</td>\n"," <td>232</td>\n"," <td>26</td>\n"," <td>328</td>\n"," </tr>\n"," <tr>\n"," <th>2</th>\n"," <td>58</td>\n"," <td>235</td>\n"," <td>26</td>\n"," <td>330</td>\n"," </tr>\n"," <tr>\n"," <th>3</th>\n"," <td>56</td>\n"," <td>240</td>\n"," <td>25</td>\n"," <td>335</td>\n"," </tr>\n"," <tr>\n"," <th>4</th>\n"," <td>52</td>\n"," <td>242</td>\n"," <td>24</td>\n"," <td>320</td>\n"," </tr>\n"," <tr>\n"," <th>5</th>\n"," <td>55</td>\n"," <td>245</td>\n"," <td>26</td>\n"," <td>325</td>\n"," </tr>\n"," <tr>\n"," <th>6</th>\n"," <td>58</td>\n"," <td>232</td>\n"," <td>26</td>\n"," <td>310</td>\n"," </tr>\n"," <tr>\n"," <th>7</th>\n"," <td>68</td>\n"," <td>230</td>\n"," <td>26</td>\n"," <td>340</td>\n"," </tr>\n"," <tr>\n"," <th>8</th>\n"," <td>62</td>\n"," <td>228</td>\n"," <td>24</td>\n"," <td>350</td>\n"," </tr>\n"," <tr>\n"," <th>9</th>\n"," <td>78</td>\n"," <td>220</td>\n"," <td>26</td>\n"," <td>360</td>\n"," </tr>\n"," <tr>\n"," <th>10</th>\n"," <td>90</td>\n"," <td>200</td>\n"," <td>26</td>\n"," <td>328</td>\n"," </tr>\n"," <tr>\n"," <th>11</th>\n"," <td>40</td>\n"," <td>220</td>\n"," <td>26</td>\n"," <td>320</td>\n"," </tr>\n"," <tr>\n"," <th>12</th>\n"," <td>50</td>\n"," <td>226</td>\n"," <td>26</td>\n"," <td>325</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>\n"," <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-3f8bf07f-2d33-4f80-9a73-0e8884ef2f07')\"\n"," title=\"Convert this dataframe to an interactive table.\"\n"," style=\"display:none;\">\n","\n"," <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n"," <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n"," </svg>\n"," </button>\n","\n","\n","\n"," <div id=\"df-6f44b628-efd8-4c79-b6e6-4daef327db92\">\n"," <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-6f44b628-efd8-4c79-b6e6-4daef327db92')\"\n"," title=\"Suggest charts.\"\n"," style=\"display:none;\">\n","\n","<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <g>\n"," <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n"," </g>\n","</svg>\n"," </button>\n"," </div>\n","\n","<style>\n"," .colab-df-quickchart {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-quickchart:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n","</style>\n","\n"," <script>\n"," async function quickchart(key) {\n"," const containerElement = document.querySelector('#' + key);\n"," const charts = await google.colab.kernel.invokeFunction(\n"," 'suggestCharts', [key], {});\n"," }\n"," </script>\n","\n"," <script>\n","\n","function displayQuickchartButton(domScope) {\n"," let quickchartButtonEl =\n"," domScope.querySelector('#df-6f44b628-efd8-4c79-b6e6-4daef327db92 button.colab-df-quickchart');\n"," quickchartButtonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","}\n","\n"," displayQuickchartButton(document);\n"," </script>\n"," <style>\n"," .colab-df-container {\n"," display:flex;\n"," flex-wrap:wrap;\n"," gap: 12px;\n"," }\n","\n"," .colab-df-convert {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-convert:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-convert {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-convert:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n"," </style>\n","\n"," <script>\n"," const buttonEl =\n"," document.querySelector('#df-3f8bf07f-2d33-4f80-9a73-0e8884ef2f07 button.colab-df-convert');\n"," buttonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","\n"," async function convertToInteractive(key) {\n"," const element = document.querySelector('#df-3f8bf07f-2d33-4f80-9a73-0e8884ef2f07');\n"," const dataTable =\n"," await google.colab.kernel.invokeFunction('convertToInteractive',\n"," [key], {});\n"," if (!dataTable) return;\n","\n"," const docLinkHtml = 'Like what you see? Visit the ' +\n"," '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n"," + ' to learn more about interactive tables.';\n"," element.innerHTML = '';\n"," dataTable['output_type'] = 'display_data';\n"," await google.colab.output.renderOutput(dataTable, element);\n"," const docLink = document.createElement('div');\n"," docLink.innerHTML = docLinkHtml;\n"," element.appendChild(docLink);\n"," }\n"," </script>\n"," </div>\n"," </div>\n"]},"metadata":{},"execution_count":8}]},{"cell_type":"code","source":["dados_vinho.head()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":206},"id":"2saINxN89k0b","executionInfo":{"status":"ok","timestamp":1690807208556,"user_tz":180,"elapsed":10,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"c05e42dc-e051-41ce-88d5-25185e22f66b"},"execution_count":9,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" preco_vinho_italiano gasto_propaganda temperatura vendas_vinho_nacional\n","0 50 230 27 328\n","1 50 232 26 328\n","2 58 235 26 330\n","3 56 240 25 335\n","4 52 242 24 320"],"text/html":["\n","\n"," <div id=\"df-aff0d128-63fe-4816-acd0-8fbddbb9a7dc\">\n"," <div class=\"colab-df-container\">\n"," <div>\n","<style scoped>\n"," .dataframe tbody tr th:only-of-type {\n"," vertical-align: middle;\n"," }\n","\n"," .dataframe tbody tr th {\n"," vertical-align: top;\n"," }\n","\n"," .dataframe thead th {\n"," text-align: right;\n"," }\n","</style>\n","<table border=\"1\" class=\"dataframe\">\n"," <thead>\n"," <tr style=\"text-align: right;\">\n"," <th></th>\n"," <th>preco_vinho_italiano</th>\n"," <th>gasto_propaganda</th>\n"," <th>temperatura</th>\n"," <th>vendas_vinho_nacional</th>\n"," </tr>\n"," </thead>\n"," <tbody>\n"," <tr>\n"," <th>0</th>\n"," <td>50</td>\n"," <td>230</td>\n"," <td>27</td>\n"," <td>328</td>\n"," </tr>\n"," <tr>\n"," <th>1</th>\n"," <td>50</td>\n"," <td>232</td>\n"," <td>26</td>\n"," <td>328</td>\n"," </tr>\n"," <tr>\n"," <th>2</th>\n"," <td>58</td>\n"," <td>235</td>\n"," <td>26</td>\n"," <td>330</td>\n"," </tr>\n"," <tr>\n"," <th>3</th>\n"," <td>56</td>\n"," <td>240</td>\n"," <td>25</td>\n"," <td>335</td>\n"," </tr>\n"," <tr>\n"," <th>4</th>\n"," <td>52</td>\n"," <td>242</td>\n"," <td>24</td>\n"," <td>320</td>\n"," </tr>\n"," </tbody>\n","</table>\n","</div>\n"," <button class=\"colab-df-convert\" onclick=\"convertToInteractive('df-aff0d128-63fe-4816-acd0-8fbddbb9a7dc')\"\n"," title=\"Convert this dataframe to an interactive table.\"\n"," style=\"display:none;\">\n","\n"," <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <path d=\"M0 0h24v24H0V0z\" fill=\"none\"/>\n"," <path d=\"M18.56 5.44l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94zm-11 1L8.5 8.5l.94-2.06 2.06-.94-2.06-.94L8.5 2.5l-.94 2.06-2.06.94zm10 10l.94 2.06.94-2.06 2.06-.94-2.06-.94-.94-2.06-.94 2.06-2.06.94z\"/><path d=\"M17.41 7.96l-1.37-1.37c-.4-.4-.92-.59-1.43-.59-.52 0-1.04.2-1.43.59L10.3 9.45l-7.72 7.72c-.78.78-.78 2.05 0 2.83L4 21.41c.39.39.9.59 1.41.59.51 0 1.02-.2 1.41-.59l7.78-7.78 2.81-2.81c.8-.78.8-2.07 0-2.86zM5.41 20L4 18.59l7.72-7.72 1.47 1.35L5.41 20z\"/>\n"," </svg>\n"," </button>\n","\n","\n","\n"," <div id=\"df-cf09f13e-2807-4d2b-b3e8-3071dc690e41\">\n"," <button class=\"colab-df-quickchart\" onclick=\"quickchart('df-cf09f13e-2807-4d2b-b3e8-3071dc690e41')\"\n"," title=\"Suggest charts.\"\n"," style=\"display:none;\">\n","\n","<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\"viewBox=\"0 0 24 24\"\n"," width=\"24px\">\n"," <g>\n"," <path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 17H7v-7h2v7zm4 0h-2V7h2v10zm4 0h-2v-4h2v4z\"/>\n"," </g>\n","</svg>\n"," </button>\n"," </div>\n","\n","<style>\n"," .colab-df-quickchart {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-quickchart:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-quickchart:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n","</style>\n","\n"," <script>\n"," async function quickchart(key) {\n"," const containerElement = document.querySelector('#' + key);\n"," const charts = await google.colab.kernel.invokeFunction(\n"," 'suggestCharts', [key], {});\n"," }\n"," </script>\n","\n"," <script>\n","\n","function displayQuickchartButton(domScope) {\n"," let quickchartButtonEl =\n"," domScope.querySelector('#df-cf09f13e-2807-4d2b-b3e8-3071dc690e41 button.colab-df-quickchart');\n"," quickchartButtonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","}\n","\n"," displayQuickchartButton(document);\n"," </script>\n"," <style>\n"," .colab-df-container {\n"," display:flex;\n"," flex-wrap:wrap;\n"," gap: 12px;\n"," }\n","\n"," .colab-df-convert {\n"," background-color: #E8F0FE;\n"," border: none;\n"," border-radius: 50%;\n"," cursor: pointer;\n"," display: none;\n"," fill: #1967D2;\n"," height: 32px;\n"," padding: 0 0 0 0;\n"," width: 32px;\n"," }\n","\n"," .colab-df-convert:hover {\n"," background-color: #E2EBFA;\n"," box-shadow: 0px 1px 2px rgba(60, 64, 67, 0.3), 0px 1px 3px 1px rgba(60, 64, 67, 0.15);\n"," fill: #174EA6;\n"," }\n","\n"," [theme=dark] .colab-df-convert {\n"," background-color: #3B4455;\n"," fill: #D2E3FC;\n"," }\n","\n"," [theme=dark] .colab-df-convert:hover {\n"," background-color: #434B5C;\n"," box-shadow: 0px 1px 3px 1px rgba(0, 0, 0, 0.15);\n"," filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.3));\n"," fill: #FFFFFF;\n"," }\n"," </style>\n","\n"," <script>\n"," const buttonEl =\n"," document.querySelector('#df-aff0d128-63fe-4816-acd0-8fbddbb9a7dc button.colab-df-convert');\n"," buttonEl.style.display =\n"," google.colab.kernel.accessAllowed ? 'block' : 'none';\n","\n"," async function convertToInteractive(key) {\n"," const element = document.querySelector('#df-aff0d128-63fe-4816-acd0-8fbddbb9a7dc');\n"," const dataTable =\n"," await google.colab.kernel.invokeFunction('convertToInteractive',\n"," [key], {});\n"," if (!dataTable) return;\n","\n"," const docLinkHtml = 'Like what you see? Visit the ' +\n"," '<a target=\"_blank\" href=https://colab.research.google.com/notebooks/data_table.ipynb>data table notebook</a>'\n"," + ' to learn more about interactive tables.';\n"," element.innerHTML = '';\n"," dataTable['output_type'] = 'display_data';\n"," await google.colab.output.renderOutput(dataTable, element);\n"," const docLink = document.createElement('div');\n"," docLink.innerHTML = docLinkHtml;\n"," element.appendChild(docLink);\n"," }\n"," </script>\n"," </div>\n"," </div>\n"]},"metadata":{},"execution_count":9}]},{"cell_type":"markdown","source":["##Permutação e Combinação"],"metadata":{"id":"fxZz-LQR-hwP"}},{"cell_type":"markdown","source":["\n","\n","* Permutações sem repetição\n","\n","\n","\n"],"metadata":{"id":"S72Uiyol-rXx"}},{"cell_type":"code","source":["cores = ['amarela', 'preta', 'vermelha']"],"metadata":{"id":"sXF08ZcP-2Li","executionInfo":{"status":"ok","timestamp":1690807561954,"user_tz":180,"elapsed":1374,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":10,"outputs":[]},{"cell_type":"code","source":["permutacoes = permutations(cores, 3)"],"metadata":{"id":"S5g1A8g_-_jd","executionInfo":{"status":"ok","timestamp":1690807676626,"user_tz":180,"elapsed":998,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":20,"outputs":[]},{"cell_type":"code","source":["list(permutacoes)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"tXnojoRd_Hoo","executionInfo":{"status":"ok","timestamp":1690807681303,"user_tz":180,"elapsed":6,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"158fe5eb-b875-4921-a04e-3a203c821894"},"execution_count":21,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[('amarela', 'preta', 'vermelha'),\n"," ('amarela', 'vermelha', 'preta'),\n"," ('preta', 'amarela', 'vermelha'),\n"," ('preta', 'vermelha', 'amarela'),\n"," ('vermelha', 'amarela', 'preta'),\n"," ('vermelha', 'preta', 'amarela')]"]},"metadata":{},"execution_count":21}]},{"cell_type":"markdown","source":["\n","\n","* Permutação com repetição\n","\n","\n","\n","\n"],"metadata":{"id":"uaZ5bJFo_xtl"}},{"cell_type":"code","source":["cores = ['amarela', 'preta', 'vermelha']"],"metadata":{"id":"ivYO7M-4_5g1","executionInfo":{"status":"ok","timestamp":1690807832070,"user_tz":180,"elapsed":24,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":22,"outputs":[]},{"cell_type":"code","source":["permutacoes = product(cores, repeat= 3)"],"metadata":{"id":"T8n5zMW6ACw8","executionInfo":{"status":"ok","timestamp":1690807911268,"user_tz":180,"elapsed":3,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":23,"outputs":[]},{"cell_type":"code","source":["list(permutacoes)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"_yCPMUtGAU2l","executionInfo":{"status":"ok","timestamp":1690807929947,"user_tz":180,"elapsed":409,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"2c92830a-0fe1-4358-81a8-f3a40d03a0a9"},"execution_count":24,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[('azul', 'azul', 'azul'),\n"," ('azul', 'azul', 'branca'),\n"," ('azul', 'azul', 'lilás'),\n"," ('azul', 'branca', 'azul'),\n"," ('azul', 'branca', 'branca'),\n"," ('azul', 'branca', 'lilás'),\n"," ('azul', 'lilás', 'azul'),\n"," ('azul', 'lilás', 'branca'),\n"," ('azul', 'lilás', 'lilás'),\n"," ('branca', 'azul', 'azul'),\n"," ('branca', 'azul', 'branca'),\n"," ('branca', 'azul', 'lilás'),\n"," ('branca', 'branca', 'azul'),\n"," ('branca', 'branca', 'branca'),\n"," ('branca', 'branca', 'lilás'),\n"," ('branca', 'lilás', 'azul'),\n"," ('branca', 'lilás', 'branca'),\n"," ('branca', 'lilás', 'lilás'),\n"," ('lilás', 'azul', 'azul'),\n"," ('lilás', 'azul', 'branca'),\n"," ('lilás', 'azul', 'lilás'),\n"," ('lilás', 'branca', 'azul'),\n"," ('lilás', 'branca', 'branca'),\n"," ('lilás', 'branca', 'lilás'),\n"," ('lilás', 'lilás', 'azul'),\n"," ('lilás', 'lilás', 'branca'),\n"," ('lilás', 'lilás', 'lilás')]"]},"metadata":{},"execution_count":24}]},{"cell_type":"markdown","source":["\n","\n","* Combinações sem repetição\n","\n"],"metadata":{"id":"jir6IG9AAj2Z"}},{"cell_type":"code","source":["cores = ['beje', 'laranja', 'azul', 'roxo']"],"metadata":{"id":"eRW77JZpAo7z","executionInfo":{"status":"ok","timestamp":1690808141613,"user_tz":180,"elapsed":460,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":25,"outputs":[]},{"cell_type":"code","source":["combinacao = combinations(cores, 2)"],"metadata":{"id":"Xp4_gAwkBNUA","executionInfo":{"status":"ok","timestamp":1690808266177,"user_tz":180,"elapsed":729,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":36,"outputs":[]},{"cell_type":"code","source":["list(combinacao)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"PacV56KqBUOO","executionInfo":{"status":"ok","timestamp":1690808269198,"user_tz":180,"elapsed":985,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"f84fd211-bdeb-4d0f-e144-488cbfea780f"},"execution_count":37,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[('beje', 'laranja'),\n"," ('beje', 'azul'),\n"," ('beje', 'roxo'),\n"," ('laranja', 'azul'),\n"," ('laranja', 'roxo'),\n"," ('azul', 'roxo')]"]},"metadata":{},"execution_count":37}]},{"cell_type":"markdown","source":["\n","\n","* Combinações com repetição\n","\n","\n"],"metadata":{"id":"6GQj2Ct-BszR"}},{"cell_type":"code","source":["cores = ['beje', 'laranja', 'azul', 'lilás']"],"metadata":{"id":"gXSYn6koBzMT","executionInfo":{"status":"ok","timestamp":1690808323934,"user_tz":180,"elapsed":569,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":38,"outputs":[]},{"cell_type":"code","source":["combinacao_com_rep = combinations_with_replacement(cores, 2)"],"metadata":{"id":"47M2sgCQB5cC","executionInfo":{"status":"ok","timestamp":1690808365698,"user_tz":180,"elapsed":886,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}}},"execution_count":39,"outputs":[]},{"cell_type":"code","source":["list(combinacao_com_rep)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"aHZBf9iwCDel","executionInfo":{"status":"ok","timestamp":1690808380950,"user_tz":180,"elapsed":403,"user":{"displayName":"Isabella Orlando","userId":"14405721422426458542"}},"outputId":"417e17a9-b26f-4af7-e2e5-89cd21195b9e"},"execution_count":40,"outputs":[{"output_type":"execute_result","data":{"text/plain":["[('beje', 'beje'),\n"," ('beje', 'laranja'),\n"," ('beje', 'azul'),\n"," ('beje', 'lilás'),\n"," ('laranja', 'laranja'),\n"," ('laranja', 'azul'),\n"," ('laranja', 'lilás'),\n"," ('azul', 'azul'),\n"," ('azul', 'lilás'),\n"," ('lilás', 'lilás')]"]},"metadata":{},"execution_count":40}]}]}