Skip to content

Commit

Permalink
Change notebook to work in JupyterLite
Browse files Browse the repository at this point in the history
  • Loading branch information
augusto-herrmann committed Mar 8, 2024
1 parent c262b42 commit 45cd2c6
Showing 1 changed file with 44 additions and 33 deletions.
77 changes: 44 additions & 33 deletions jupyterlite/notebooks/pgc_pca/pgc_pca_itens_apresentacao.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -172,24 +172,11 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"id": "Hvn3T7_frerN",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "4ab1a203-4350-4251-9dce-86899026042d",
"cellView": "form"
"id": "Hvn3T7_frerN"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Mounted at /content/drive\n"
]
}
],
"outputs": [],
"source": [
"# @title Feramentas necessárias\n",
"# Import\n",
Expand All @@ -200,10 +187,7 @@
"import matplotlib.pyplot as plt\n",
"from tqdm import tqdm # Importa o tqdm\n",
"from time import sleep\n",
"from IPython.display import IFrame\n",
"\n",
"from google.colab import drive\n",
"drive.mount('/content/drive')"
"from IPython.display import IFrame"
]
},
{
Expand Down Expand Up @@ -279,7 +263,7 @@
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "42c61235-4ccf-4350-cfd9-3b12247a3b68"
"outputId": "323504fa-00a2-41c4-990d-743f3af2a682"
},
"execution_count": null,
"outputs": [
Expand Down Expand Up @@ -679,8 +663,7 @@
" break"
],
"metadata": {
"id": "anxTBv7vPmWO",
"cellView": "form"
"id": "anxTBv7vPmWO"
},
"execution_count": null,
"outputs": []
Expand All @@ -702,8 +685,7 @@
"display(df_itens_planejados)"
],
"metadata": {
"id": "UjnuLrnVGQvD",
"cellView": "form"
"id": "UjnuLrnVGQvD"
},
"execution_count": null,
"outputs": []
Expand All @@ -722,13 +704,27 @@
"source": [
"# @title Extração 06/03/2024\n",
"# carregar planilha armazenada no local: /content/drive/MyDrive/MGI/pgc_pca/items_planejados.csv\n",
"df_itens_planejados = pd.read_csv(\"/content/drive/MyDrive/MGI/pgc_pca/items_planejados20240306.csv\")\n",
"#df_itens_planejados = pd.read_csv(\"/content/drive/MyDrive/MGI/pgc_pca/items_planejados20240306.csv\")\n",
"\n",
"# Link de compartilhamento direto para o arquivo CSV\n",
"url = \"https://drive.google.com/uc?id=1wnnPFrg8Aem6j2wFLfehYbAUH0wedp1K\"\n",
"\n",
"# Tentar ler o arquivo CSV com diferentes separadores\n",
"separadores = [\",\", \";\", \"\\t\"] # Tente vírgula, ponto e vírgula e tabulação\n",
"for separador in separadores:\n",
" try:\n",
" df_itens_planejados = pd.read_csv(url, encoding=\"utf-8\", sep=separador)\n",
" print(f\"Arquivo lido com sucesso usando o separador: {separador}\")\n",
" display(df_itens_planejados.head())\n",
" break\n",
" except Exception as e:\n",
" print(f\"Erro ao ler o arquivo com o separador {separador}: {e}\")\n",
"\n",
"# Exibindo o DataFrame\n",
"display(df_itens_planejados)\n"
],
"metadata": {
"id": "h3YwMZ-jL2oS",
"cellView": "form"
"id": "h3YwMZ-jL2oS"
},
"execution_count": null,
"outputs": []
Expand All @@ -749,8 +745,7 @@
"IFrame('https://app.powerbi.com/view?r=eyJrIjoiZWFlZTA2YjctZGJhNy00ZmVhLTlkN2ItN2JjNTQ2Zjc0NGM5IiwidCI6IjNlYzkyOTY5LTVhNTEtNGYxOC04YWM5LWVmOThmYmFmYTk3OCJ9&pageName=ReportSection8c1c4be1e8ccb714b3eb', width=1140, height=540)\n"
],
"metadata": {
"id": "bxIbuIO9_CNl",
"cellView": "form"
"id": "bxIbuIO9_CNl"
},
"execution_count": null,
"outputs": []
Expand All @@ -762,12 +757,28 @@
"IFrame('https://app.powerbi.com/view?r=eyJrIjoiZWFlZTA2YjctZGJhNy00ZmVhLTlkN2ItN2JjNTQ2Zjc0NGM5IiwidCI6IjNlYzkyOTY5LTVhNTEtNGYxOC04YWM5LWVmOThmYmFmYTk3OCJ9&pageName=ReportSectionf63e169e0dd38a9042ab', width=1140, height=540)"
],
"metadata": {
"id": "_180LdLzAji9",
"cellView": "form"
"id": "_180LdLzAji9"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"*link painel*\n",
"\n",
"[Painel PCG_PCA](https://app.powerbi.com/view?r=eyJrIjoiZWFlZTA2YjctZGJhNy00ZmVhLTlkN2ItN2JjNTQ2Zjc0NGM5IiwidCI6IjNlYzkyOTY5LTVhNTEtNGYxOC04YWM5LWVmOThmYmFmYTk3OCJ9)\n",
"\n",
"\n",
"\n",
"---\n",
"---\n",
"\n"
],
"metadata": {
"id": "ss4trLLvgcxu"
}
},
{
"cell_type": "markdown",
"source": [
Expand Down Expand Up @@ -809,7 +820,7 @@
},
"cellView": "form",
"id": "6RxLSMY3FG_b",
"outputId": "f8c9101d-ca35-48e9-f9ab-66bf897c5366"
"outputId": "07331965-1e43-40ab-b24f-9aa42c66f5e2"
},
"execution_count": null,
"outputs": [
Expand Down

0 comments on commit 45cd2c6

Please sign in to comment.