डेटासेट का परिचय

इंटरमीडिएट Network Analysis in Python

Eric Ma

Data Carpentry instructor and author of nxviz package

डेटासेट और केस स्टडी परिचय

  • कॉलेज फोरम पोस्टिंग डेटासेट, 6 महीने
  • नोड पार्टिशन: छात्र, फोरम
  • इस चैप्टर की गतिविधियाँ:
    • pandas DataFrame से ग्राफ बनाना
    • bipartite ग्राफ के unipartite projections निकालना
    • विज़ुअलाइज़ेशन
    • टाइम सीरीज़ फ़िल्टरिंग व विश्लेषण
  • पहले उपयोग किए गए फंक्शन का रिकैप
इंटरमीडिएट Network Analysis in Python

DataFrames से ग्राफ

df
   customers    products
0  customerA    product1
1  customerB    product2
...
G = nx.Graph()

G.add_nodes_from(df['products'], bipartite='products') G.add_nodes_from(df['customers'], bipartite='customers')
list(G.nodes())
['product1', 'customerC', 'product2', 'customerB', 'customerA']
list(G.edges())
[]
इंटरमीडिएट Network Analysis in Python

DataFrames से ग्राफ

G.add_edges_from(zip(df['customers'], df['products']))

list(G.edges())
[('product1', 'customerC'), ('product1', 'customerA'), 
    ('customerC', 'product2'), ('product2', 'customerB')]
इंटरमीडिएट Network Analysis in Python

Bipartite projections

cust_nodes = [n for n in G.nodes() if G.nodes[n]
                 ['bipartite'] == 'customers']

prod_nodes = [n for n in G.nodes() if G.nodes[n] ['bipartite'] == 'products']
prodG = nx.bipartite.projected_graph(G, nodes=prod_nodes) custG = nx.bipartite.projected_graph(G, nodes=cust_nodes)
list(prodG.nodes())
['product1', 'product2']
list(custG.nodes())
['customerC', 'customerB', 'customerA']
इंटरमीडिएट Network Analysis in Python

अभ्यास करते हैं!

इंटरमीडिएट Network Analysis in Python

Preparing Video For Download...