{ "cells": [ { "cell_type": "markdown", "id": "11ed1f45", "metadata": {}, "source": [ "# Case Study 2\n", "\n", "The file train.csv (https://raw.githubusercontent.com/masterfloss/data/main/train.csv) is a file that stores information about portuguese railway network.\n", "\n", "* Create a datframe using the information\n", "* Explore data using pandas (e.g. count the number of tunnels, total length of tunnels, number of briges, totl length of briges, count the number of lines, average speed, draw a map with the coodinates of in column geometry)\n", "* Create a network using the dataframe\n", "* Explore main network metrics \n", "* Eplore main metrix related to each node\n", "\n", "\n", "hints:\n", " \n", " G=nx.from_pandas_edgelist(df)\n", " \n", " df.groupby(by=[\"name\"]).sum()\n", " \n", " df[df.tunnel=='yes'].count()\n", " \n", " https://networkx.org/documentation/stable/tutorial.html\n", " \n", " https://networkx.org/documentation/stable/reference/algorithms/centrality.html" ] }, { "cell_type": "code", "execution_count": 1, "id": "5e68ff43", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import networkx as nx" ] } ], "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.12" } }, "nbformat": 4, "nbformat_minor": 5 }