{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "view-in-github", "colab_type": "text" }, "source": [ "\"Open" ] }, { "cell_type": "markdown", "id": "0c0315b9", "metadata": { "id": "0c0315b9" }, "source": [ "# Creación de una Tabla con Pandas" ] }, { "cell_type": "markdown", "id": "a5a90f7c", "metadata": { "id": "a5a90f7c" }, "source": [ "Si no está instalado pandas se puede instalar con: \n", "```pip install pandas``` \n", "\n", "Si no está instalado matplotlib se puede instalar con: \n", "```pip install matplotlib```" ] }, { "cell_type": "code", "execution_count": null, "id": "bdc7a934", "metadata": { "id": "bdc7a934", "outputId": "8bf86ec9-a201-4e71-eab3-7fef12e219bd" }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
valorcuadrado
011
124
239
\n", "
" ], "text/plain": [ " valor cuadrado\n", "0 1 1\n", "1 2 4\n", "2 3 9" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "tabla = pd.DataFrame(data = [[1,1], [2,4], [3,9]],\n", " columns = ['valor', 'cuadrado'])\n", "\n", "tabla" ] }, { "cell_type": "markdown", "id": "d91e17ee", "metadata": { "id": "d91e17ee" }, "source": [ "## Gráfico" ] }, { "cell_type": "code", "execution_count": null, "id": "1a60c3bb", "metadata": { "id": "1a60c3bb", "outputId": "8a9b3e67-8b80-44d9-db92-17249dfc4631" }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8rg+JYAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgUElEQVR4nO3deXRU5eHG8e8LCYSwJEASEpYQ9rBvASNWXFAKa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n52DjAOyPAcPwV4GEg8JpsTY+ZNLifGLAF4w1RdDrAe8I619jNjzG3H5HJivLzJ5dRz7CeCYLy8yeXEeLUCPvT8vxEGzLLWzvXneOmj9CIiISrUDqGIiIiHClxEJESpwEVEQpQKXEQkRKnARURClApcRCREqcBFRELU/wNfEtyzqJAHoAAAAABJRU5ErkJggg==\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt\n", "x = [1, 2, 3, 4, 5]\n", "y = [1, 4, 9, 16, 25]\n", "plt.plot(x,y)\n", "plt.show()" ] }, { "cell_type": "markdown", "id": "217cb671", "metadata": { "id": "217cb671" }, "source": [ "# Creación de un DataFrame de redes sociales \n", "## Creamos las listas \n", "Por cada red social creamos una lista con los siguientes datos: nombre, millones de usuarios, si es o no del grupo Facebook, Año de creación" ] }, { "cell_type": "code", "execution_count": null, "id": "6452a9bd", "metadata": { "id": "6452a9bd" }, "outputs": [], "source": [ "fbk = ['Facebook', 2740, True, 2006]\n", "twt = ['Twitter',339, False, 2006]\n", "ig = ['Instagram', 1221, True, 2010]\n", "yt = ['YouTube', 2291, False, 2005]\n", "lkn = ['LinkedIn', 727, False, 2003]\n", "wsp = ['WhatsApp', 2000, True, 2009]\n", "tik = ['TikTok', 689, False, 2016]\n", "tel = ['Telegram', 500, False, 2013]" ] }, { "cell_type": "markdown", "id": "2e28e17b", "metadata": { "id": "2e28e17b" }, "source": [ "## Creamos la lista de listas \n", "Creamos una matriz, un array 2D, formado como lista de listas." ] }, { "cell_type": "code", "execution_count": null, "id": "d335de19", "metadata": { "id": "d335de19", "outputId": "bb58c3c9-f91d-43ff-e66e-54427d933670", "colab": { "base_uri": "https://localhost:8080/" } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "[['Facebook', 2740, True, 2006],\n", " ['Twitter', 339, False, 2006],\n", " ['Instagram', 1221, True, 2010],\n", " ['YouTube', 2291, False, 2005],\n", " ['LinkedIn', 727, False, 2003],\n", " ['WhatsApp', 2000, True, 2009],\n", " ['TikTok', 689, False, 2016],\n", " ['Telegram', 500, False, 2013]]" ] }, "metadata": {}, "execution_count": 3 } ], "source": [ "rrss = [fbk, twt, ig, yt, lkn, wsp, tik, tel] # redes sociales 2021\n", "rrss" ] }, { "cell_type": "code", "execution_count": null, "id": "40a3ebeb", "metadata": { "id": "40a3ebeb", "outputId": "62e089f3-cacb-4d80-cc5b-2150853dd94a", "colab": { "base_uri": "https://localhost:8080/", "height": 300 } }, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ " Nombre Usuarios es_FBK Año\n", "0 Facebook 2740 True 2006\n", "1 Twitter 339 False 2006\n", "2 Instagram 1221 True 2010\n", "3 YouTube 2291 False 2005\n", "4 LinkedIn 727 False 2003\n", "5 WhatsApp 2000 True 2009\n", "6 TikTok 689 False 2016\n", "7 Telegram 500 False 2013" ], "text/html": [ "\n", "
\n", "
\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NombreUsuarioses_FBKAño
0Facebook2740True2006
1Twitter339False2006
2Instagram1221True2010
3YouTube2291False2005
4LinkedIn727False2003
5WhatsApp2000True2009
6TikTok689False2016
7Telegram500False2013
\n", "
\n", " \n", " \n", " \n", "\n", " \n", "
\n", "
\n", " " ] }, "metadata": {}, "execution_count": 4 } ], "source": [ "import pandas as pd\n", "pd.DataFrame(rrss, columns = ['Nombre', 'Usuarios', 'es_FBK', 'Año'])\n", "# es_FBK es una bandera ('Flag'), esto es una marca" ] }, { "cell_type": "markdown", "id": "b5dd5aa6", "metadata": { "id": "b5dd5aa6" }, "source": [ "Ya está creado el **DataFrame** que se puede visualizar bien y luego podemos tratar con herramientas de análisis." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.11" }, "colab": { "name": "0010_tabla_con_pandas.ipynb", "provenance": [], "include_colab_link": true } }, "nbformat": 4, "nbformat_minor": 5 }