Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Network Science with Python and NetworkX Quick Start Guide

You're reading from  Network Science with Python and NetworkX Quick Start Guide

Product type Book
Published in Apr 2019
Publisher Packt
ISBN-13 9781789955316
Pages 190 pages
Edition 1st Edition
Languages
Author (1):
Edward L. Platt Edward L. Platt
Profile icon Edward L. Platt

Table of Contents (15) Chapters

Preface 1. What is a Network? 2. Working with Networks in NetworkX 3. From Data to Networks 4. Affiliation Networks 5. The Small Scale - Nodes and Centrality 6. The Big Picture - Describing Networks 7. In-Between - Communities 8. Social Networks and Going Viral 9. Simulation and Analysis 10. Networks in Space and Time 11. Visualization 12. Conclusion 13. Other Books You May Enjoy Appendix

Affiliation networks in NetworkX

Affiliation networks are represented in NetworkX using the same classes as other networks: Graph and DiGraph. The only difference is that you need to keep track of which nodes are of which type. In NetworkX, this is done by using a container (list, set, and so on) to store all node IDs for one node type. For convenience, the node type can also be stored as a node attribute. A network can be tested for an affiliation network structure using the sets() function. Usually, this function can also find the nodes of each type (the exception being when the network has groups of nodes that are not connected to the rest of the network). The following example loads our dear old friend from Chapter 2, Working with Networks in NetworkX, the Zachary karate club network, and checks it for affiliation network structure:

# Import bipartite module
from networkx.algorithms...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}