<jupyter_start><jupyter_text>Networkx basic tutorial[Networkx basic tutorial](http://pynetwork.readthedocs.io/en/latest/networkx_basics.html)<jupyter_code>%matplotlib inline
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import networkx as nx
G = nx.Graph() 
G.add_nodes_from([1,2,3,4]) 
G.add_edges_from([(1,2),(3,4)]) 
G.number_of_nodes(), G.number_of_edges() 
G = nx.karate_club_graph()
G.number_of_nodes()
G.degree()[0]
G.degree(0) is G.degree()[0]
with plt.xkcd():
    nx.draw(G)<jupyter_output><empty_output><jupyter_text>Generate graph - Erdos Renyi<jupyter_code>G = nx.erdos_renyi_graph(n=10, p=0)
nx.number_connected_components(G)
G.edges(data=True)
nx.erdos_renyi_graph(100, 0.03).degree()
len(nx.erdos_renyi_graph(100, 0.30))
nx.draw(G)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15480649188514356, 'fraction_numerical': 0.03245942571785269, 'mean_word_length': 7.623655913978495, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '614911', 'license': 'MIT', 'n_tokens_mistral': 365, 'n_tokens_neox': 346, 'n_words': 50, 'path': 'nxgraphs_basic_intro.ipynb', 'repo_name': 'aixpact/networks', 'size': '801'}