{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "from webweb import Web" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Create a random network" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "N = 150\n", "p = 0.01\n", "\n", "edge_list = []\n", "for i in range(1,N):\n", " for j in range(i):\n", " if np.random.rand() < p:\n", " edge_list.append([i,j])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Show it using webweb" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "Web(edge_list).show()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }