Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Network Science with Python and NetworkX Quick Start Guide
Network Science with Python and NetworkX Quick Start Guide

Network Science with Python and NetworkX Quick Start Guide: Explore and visualize network data effectively

eBook
€13.98 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Network Science with Python and NetworkX Quick Start Guide

What is a Network?

In 1736, a Swiss mathematician pondered routes for a sightseeing trip along the Pregel River in Königsberg. In 1880, an Italian painter turned zoologist sought to settle a hotly-contested controversy: whether or not birds protect crops by reducing insect populations. In 1932, the superintendent of a girls' reformatory school in Hudson, New York, hired a sociologist to investigate the cause of a recent wave of runaways. In 1955, a U.S. Army General and a mathematician developed a technique for identifying bottlenecks in the Soviet railway system. And, in 1998, two mathematicians in Ithaca, New York tried to figure out (among other things) why exactly all movie stars seem to be connected by Kevin Bacon.

These puzzles, taking place at different times and different places, might, at first glance, appear unrelated. But they have one thing in common: they all revolve around relationships – between people, between places, or between species – and they were all solved using the science of relationships, which has come to be known as network science. Interest in network science has grown considerably in recent years, as online social network platforms, such as Facebook, Twitter, WeChat, and Mastodon, have become increasingly popular.

This book covers the fundamental concepts of network science, as well as how to put them into practice using the Python-based NetworkX package. Part I (Chapter 1, What is a Network?, to Chapter 4, Affiliation Networks) introduces the concept of a network, as well as how to build, manipulate, and visualize networks in NetworkX. Part II (Chapter 5, The Small Scale – Nodes and Centrality, to Chapter 7, In-Between – Communities) demonstrates how to analyze network structure at various scales. Part III (Chapter 8, Social Networks and Going Viral, to Chapter 11, Visualization) applies network science to understanding complex systems using modeling, simulation, and visualization. In this introductory chapter, you'll learn some of the history of network science and the differences between common types of networks. You'll also see examples of different ways that relationships in a network can be interpreted. Finally, you'll get to build and visualize your first network using NetworkX!

In this chapter, we will cover the following topics:

  • Network science: Learn the history of the study of networks.
  • What is a network?: Understand the fundamental concepts of network science.
  • What is NetworkX?: Getting familiar with the NetworkX Python package.
  • Types of networks: Meet common variants of networks, and understand their applications.
  • Your first network in NetworkX: Try a simple example.

Network science

The origins of network science trace back to many different fields. For the most part, researchers in these fields developed the tools and methods of network science without much knowledge of how it was being applied in other fields. It may seem astonishing that scientists working independently in very different fields could develop tools and techniques similar enough to now be considered a single field.

How did this happen? The answer lies in one insight: sometimes, it is useful to study the relationships between things without worrying about the specifics of what those things are. Network scientists didn't study networks for their own sake* – they studied networks in order to better understand people, animal species, atoms, and so on. (* Except for mathematicians. We like to think about weird abstract concepts such as networks just for fun.)

When the specifics of the people/species/atoms being studied were abstracted away, seemingly different problems suddenly became very similar. And that's the power of network science; it provides a general language to talk about relationships and connections, allowing discoveries about one thing to be translated into useful information about many other types of things.

The history of network science

The earliest work recognizable as network science came from the branch of mathematics known as graph theory. Graph theory originated with Leonhard Euler's 1736 solution (Euler, 1953) to the seven bridges problem. At the time, the city of Königsberg, Prussia (now Kaliningrad, Russia) had seven bridges connecting the banks of the Pregel River to two islands (pictured as follows). It was not known whether it was possible to find a path through the city that crossed every bridge exactly once. Euler showed that it was impossible, and he did so using new methods that became the basis for graph theory, and later for network science.

Leonhard Euler was a prolific 18th century mathematician. His surname is pronounced "oiler" (and his work does indeed lubricate the gears of modern mathematics). He is perhaps best remembered by his namesake: Euler's number, e 2.7 (which, confusingly, was discovered by Jacob Bernoulli):
Seventeenth-century Königsberg and its seven bridges

The study of networks also has a rich history in sociology. The sociologists, Jacob L. Moreno and Helen Hall Jennings proposed tools for the quantitative study of interpersonal relationships, which they called sociometry (Moreno & Jennings, 1934). These tools included the sociogram, a graphical representation of social networks very similar to the type of network diagrams currently in use.

When Moreno was hired by Fannie French Morse, superintendent of the New York Training School for Girls, to investigate a wave of runaways, it was sociograms that allowed him to visualize and communicate the nature of the social forces driving the runaways. Many of the tools used in modern network science—centrality, affiliation networks, community detection, and others—come from sociology. Over the past several decades, sociometry has branched into social network analysis, a rich and active subfield within network science.

Sociology is the science concerned with how individuals and their interactions produce institutions and societies. Networks are used in sociology to represent and quantify the relationships between individuals.

Various other fields have found it useful to study network structure, and have shared their tools and findings with each other as part of the interdisciplinary complex systems community. Ecologists study food webs—relationships between predator and prey species. Biologists study networks of interactions between genes. Physicists study magnetic interactions between neighboring atoms in crystals. All of these fields are doing exciting work with network science.

Complex systems are those that arise from the interactions of simpler components, for example, traffic from cars, stock markets from stock trades, and ecologies from species. Networks are used to analyze and study the interrelationships between components.

And then, of course, there's the internet. The internet itself is literally a network—computers and routers connected to each other by copper wire, fiber optic cables, and so on. But, on top of that, the content on the internet is also networked. Links between web pages form networks, and online social networks allow people to interact by friending or following each other. The Google search engine was founded on the PageRank algorithm (Page et al., 1999), a network-science-based approach to identifying popular websites. Online social networks typically make money by selling advertising space, and using network science to show ads to the people most likely to click on them. If you see a picture of a cute cat online, you can use network science to understand how the picture got to your computer screen, how the picture connects you with your friends, and what the picture tells you about other sites you might like to visit.

Online activity leaves digital trace data—records of activity stored in logs and databases. Digital trace data can often be used to construct networks of relationships between individuals. From these networks, it is surprisingly easy to predict many things, such as purchasing preferences (Zhang & Pennacchiotti, 2013), political ideology (Cohen & Ruths, 2013), and even sexual orientation (Jernigan & Mistree, 2009). The powerful techniques available for such data raises both exciting possibilities and complex ethical considerations.

Network science today

With its interdisciplinary nature, network science draws practitioners from a wide variety of backgrounds. At the time of writing this book, only a handful of universities offer programs dedicated to network science, so network scientists tend to be self-taught, or trained as sociologists, physicists, ecologists, and so on. My own path to network science was similarly convoluted. Once an aspiring physicist, I came to realize I cared more about people than atoms, and left grad school to work on technology for civic organizing. When I eventually came across network science, I was excited to find that it was a powerful tool for understanding group behavior, and that the skills I'd learned from physics transferred directly to network science. Since then, I have been using network science to better understand how groups can organize and collaborate more effectively. Whatever your background, network science is a place where everyone fits in because no one fits in.

Network science has experienced rapid growth in recent years, in part due to the popularity of online social networks, digital trace data, and tools such as NetworkX. Once scattered across many different fields, universities are now creating research centers and Ph.D. programs specifically dedicated to network science. Companies have rushed to hire data scientists, including network scientists. There has never been a better time to explore the delightful world of network data.

What is a network?

If you walk down into the Kendall Square subway station in Cambridge, Massachusetts, through the turnstiles and past the Paul Matisse art installation, you will see a common feature of all subways: a map.

If you have ever used a subway map, you know that they are not quite like other maps, which tend to be concerned with details like distance and terrain. Subway maps leave all that out, showing you the bare minimum you need to know to get from one place to another: which stations are connected to each other.

When you're using a subway, it doesn't matter how long a stretch of track is, what exact direction it goes in, or even whether it is above ground, underground, or under water. All you have to do is get on at one station and get off at another, possibly with some transfers between the two. Such a map is an excellent example of the types of networks used by network scientists.

Nodes and edges

In network science, a network is simply a set of things and the connections between them. The things are called nodes, and the connections are called edges. Nodes are really just placeholders for any type of thing that can have a connection or relationship, such as subway stations, people, or atoms. Similarly, edges are placeholders for connections or relationships, such as subway tracks, friendships, or molecular bonds. Just like the subway map, representing a system as a network strips away a lot of information, making it possible to focus just on the structure.

Sometimes, you might see nodes called vertices, or edges called links. Mathematicians like vertices and edges, while computer scientists prefer nodes and links. NetworkX uses nodes and edges (perhaps as a compromise?), so I will use that terminology in this book.

Visualizing networks

Networks are often visualized by drawing a dot or circle for each node and a line for each edge, as in the following diagram:

Example network with five nodes

Looking at the network in this diagram, you might as yourself where to draw the nodes. The answer is wherever you want! (Although technically possible, it might be advisable to avoid hot surfaces, the mouths of large predatory animals, and/or important historical documents.) Because networks are meant to focus on structure and connectivity, there are many ways to draw the same network. Nodes can be drawn anywhere. Edges can be straight or squiggly, long or short. Edges can even cross, but that should never be interpreted as being connected to each other!

The same network can be drawn in many other ways, as shown in the following diagram. The nodes have been labelled with letters to make it easier to compare between different network diagrams. Regardless of which diagram you look at, any particular node will be connected to the same set of other nodes. While different ways of drawing the same network are equally correct, some may be helpful at highlighting particular features of the network. Chapter 11, Visualization, describes common approaches to visualizing networks and their various applications:

Equivalent networks

What is NetworkX?

Remember NetworkX? This is a book about NetworkX. NetworkX is a Python package for modeling, analyzing, and visualizing networks. It provides classes to represent several types of networks and implementations of many of the algorithms used in network science. NetworkX is relatively easy to install and use, and has much of the functionality built-in, so it is ideal for learning network science and performing analyses on small or medium sized networks. There is excellent documentation available on the project website at https://networkx.github.io/.

At the time of writing, NetworkX is in version 2.3. While many things are exactly the same between 1.x versions and 2.x, some basic functionality has changed, so documentation and books relating to older versions may no longer be accurate. This book assumes versions at or above 2.3, so all examples here should work with recent versions of NetworkX.

NetworkX is Free and Open Source Software (FOSS). That means that the source code is available to read, modify, and redistribute (under certain conditions). The code itself is available at https://github.com/networkx/networkx. In addition to the original authors and project maintainers, NetworkX has been written by a community of dozens of contributors. If you have an idea for a new feature or a way to improve the software, you can write it yourself and contribute it back to the community.

When contributing to FOSS projects, it is good etiquette to read the contributor guidelines. These guidelines help project contributors collaborate effectively, avoid conflicting changes, and ensure reliability of the software.

Types of networks

The networks presented in this chapter so far have just the bare essentials. These networks are called simple networks because, well, they are simple. In NetworkX, simple networks are represented by the Graph class, described in detail in Chapter 2, Working with Networks in NetworkX.

The name Graph comes from the term used in math to describe networks. You'd think it would mean a picture or drawing, but in this case, it just means a network. Mathematicians often use everyday words in very specific ways that are quite different from their everyday meanings, for example, "graph", "bundle", "ring", and "clearly".

Directed networks

Sometimes, it helps to add just a little more detail to a network. The edges we've seen so far don't have any sense of coming from or going to; they are simply connections between two nodes, so they are called symmetric or undirected.

Imagine a network that represents a system of roads (edges) and intersections (nodes). A network with undirected edges would be a good representation, until you came across a one-way street. An undirected edge suggests that you can travel in either direction equally well, while in reality, driving against traffic is likely to be a rather different experience from driving with it.

When direction matters, a network is called directed. In a directed network, each edge has a source node and a target node. Typically, the edge represents a flow of some kind, for example, traffic, from the source to the target. But what if not all connections are one-way? Easy! Two-way connections are made by combining two directed edges going in opposite directions. In directed networks, edges are drawn with arrows pointing toward the target, as shown in the following diagram. In NetworkX, directed networks are represented by the DiGraph class, also described in Chapter 2, Working with Networks in NetworkX:

Example of a directed network

Weighted networks

Returning to the case of undirected networks, sometimes, not all edges are created equal. For example, in a network representing a city's water distribution system, the edges could represent a series of tubes that carry the water from one place to another. Some of these might have greater capacity than others. When edges can have different strengths, the network is called weighted, and the strength is quantified by a number called the weight. Both directed and undirected networks can be weighted. An example of a weighted network is shown in the following diagram. When visualizing a network, edge weights are often indicated by varying the thickness or opacity of the edge. Edge weights can be used to represent many different types of attributes. The most common ones are described in the next section:

Example of a weighted network

Understanding edges

Edges represent the connections and relationships that make a network. The edges and their weights can have different interpretations, depending on what the network represents. Some common interpretations include the following:

  • Friendships
  • Flows
  • Similarity
  • Distance

Social networks

In social networks, edges most often represent friendship or other interpersonal relationships. Edge weights then represent the strength of the friendship, for example, time spent together, messages exchanged, or the number of common interests.

Flow networks

Flow networks describe the movement of something (people, information, fluid, and so on) from place to place. Edge weights might represent capacity—the maximum amount that can be transported between two nodes—or the actual amount that has traveled through/across the connection.

Similarity networks

In similarity networks, connections are less literal and more abstract. Edge weights correspond to how similar two nodes are, often with zero being not at all, and one being identical. For example, one type of similarity between different people could be calculated by taking their top-10 favorite online cat videos and using the fraction of videos that appear for both people. In this case, the edge weight doesn't have anything to do with whether two people have any kind of relationship. It's quite possible to have an edge with a very high weight connecting two individuals who have never even met!

Spatial networks

Edges can also represent distance (or closeness), especially when nodes represent locations in space. When using edge weights to represent distance, the distance of an entire trip can be calculated by adding together all of the edge weights along a path. Using edge weights to represent distance can sometimes be confusing because a larger number means a weaker connection, and non-existent edges are actually edges with an infinite weight. Sometimes, it can be more intuitive to use a measure of closeness, such as the reciprocal of the distance, although that can complicate working with paths across many edges.

The previous examples cover many of the common applications of networks, but they are by no means exhaustive. Whenever a group of things can have any type of relationship or connection with each other, it is possible to capture the structure of those connections using a network.

Your first network in NetworkX

Now, let's create and visualize a small network using NetworkX! For the code in this book, you will need Python 3.4 or higher and NetworkX 2.2 or greater. I also highly recommend Jupyter Lab as an interactive Python environment. The code in this book is available as Jupyter notebooks at https://github.com/PacktPublishing/Network-Science-with-Python-and-NetworkX-Quick-Start-Guide.

The code in this book was written using NetworkX 2.3. At time of writing, NetworkX 2.3 is available but has not been officially released. All of the examples will work with NetworkX 2.2, but may have minor differences in node color and formatting.

The following example creates an undirected, unweighted network, adds edges and nodes, and then generates a visualization. Other types of networks will be discussed in Chapter 2, Working with Networks in NetworkX. First, we import the networkx package. In this book, I will use the convention of importing the library with the alias nx:

import networkx as nx

Next, we create a Graph object, representing an undirected network, given as follows:

G = nx.Graph()

Now that the graph exists, we can add nodes one at a time with the add_node() method, or all at once with add_nodes_from(). When adding nodes to a network, each node has to have a unique ID. The ID can be a number, a string, or a tuple. In fact, you can use any Python object as an ID, as long as it has a __hash__() method defined. For this example, we'll use letters as node IDs, shown as follows:

G.add_node('A')
G.add_nodes_from(['B', 'C'])

Similarly, edges can be added one at a time with add_edge(), or all at once with add_edges_from(), shown as follows:

G.add_edge('A', 'B')
G.add_edges_from([('B', 'C'), ('A', 'C')])

So far, the A, B, and C nodes, as well as the edges connecting them, have been added. The following code draws a simple visualization of the network:

plt.figure(figsize=(7.5, 7.5))
nx.draw_networkx(G)
plt.show()

In the preceding code, figure() is used to create a 7.5 by 7.5 inch figure, which will hold the visualization. The draw_networkx() function uses the Graph object G to produce a visualization. The show() function renders the visualization, but can be omitted if you are running the examples in Jupyter Lab. The visualization should appear similar to the following:

Output of draw_networkx()
NetworkX has several functions for visualizing networks, each of which allows you to customize the visualization style. Some of these functions and parameters are discussed over the remaining chapters, in particular Chapter 11, Visualization.

Your visualization may look slightly different from the one shown previously. This is because visualizations in NetworkX sometimes use randomized algorithms. The randomized algorithms can be configured to produce the same output each time by setting the random seed. The following code sets the random seeds used by NetworkX (this code will also appear at the beginning of the example code for all future chapters):

import random
from numpy import random as nprand
seed = hash("Network Science in Python") % 2**32
nprand.seed(seed)
random.seed(seed)
The pyplot figure() function is used in the preceding code to set the size of the visualization figure, but doing that each time can be tedious. Instead, it is possible to set the default figure size as follows:

plt.rcParams.update({'figure.figsize': (7.5, 7.5)})

Nodes can also be added using a nifty shortcut. If you try to add an edge referring to a node ID that isn't in the network, NetworkX will automatically add the node! So, in practice, you won't often need to call add_node() directly. The following code adds nodes and edges so that the network matches the example network from earlier and creates a new visualization:

G.add_edges_from([('B', 'D'), ('C', 'E')]) 
nx.draw_networkx(G)

The draw_networkx() function now produces a visualization including the new D and E nodes:

Output of draw_networkx() after adding nodes

Summary

From the bridges of 17th century Königsberg to the internet, network science emerged from a diverse range of fields, all seeking to quantify and study relationships of some kind. The networks in network science model relationships as edges between nodes, which can represent anything from a species of flower, to an atom in a crystal, to an individual in a society. To quantify properties of relationships, edges can be directed and/or weighted. NetworkX provides Python classes and functions to create and manipulate such networks with ease. By now, you should have a sense of the types of problems network science and NetworkX can solve. The following chapters will cover various applications of network science as well as related features of NetworkX, with examples of how they can be applied to real datasets.

References

The following is a list of resources that you can consider to get further knowledge:

  • Cohen, R., & Ruths, D. (2013). Classifying political orientation on Twitter: It's not easy!. In Seventh International AAAI Conference on Weblogs and Social Media.
  • Euler, L. (1953). Leonhard Euler and the Königsberg bridges. Scientific American, 189(1).
  • Jernigan, C., & Mistree, B. F. (2009). Gaydar: Facebook friendships expose sexual orientation. First Monday, 14(10).
  • Moreno, J. L., & Jennings, H. H. (1934). Who Shall Survive? Nervous and Mental Disease.
  • Page, L., Brin, S., Motwani, R., & Winograd, T. (1999). The PageRank citation ranking: Bringing order to the web. Stanford InfoLab.
  • Zhang, Y., & Pennacchiotti, M. (2013, May). Predicting purchase behaviors from social media. In Proceedings of the 22nd international conference on World Wide Web. ACM.
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand the terminology and basic concepts of network science
  • Leverage the power of Python and NetworkX to represent data as a network
  • Apply common techniques for working with network data of varying sizes

Description

NetworkX is a leading free and open source package used for network science with the Python programming language. NetworkX can track properties of individuals and relationships, find communities, analyze resilience, detect key network locations, and perform a wide range of important tasks. With the recent release of version 2, NetworkX has been updated to be more powerful and easy to use. If you’re a data scientist, engineer, or computational social scientist, this book will guide you in using the Python programming language to gain insights into real-world networks. Starting with the fundamentals, you’ll be introduced to the core concepts of network science, along with examples that use real-world data and Python code. This book will introduce you to theoretical concepts such as scale-free and small-world networks, centrality measures, and agent-based modeling. You’ll also be able to look for scale-free networks in real data and visualize a network using circular, directed, and shell layouts. By the end of this book, you’ll be able to choose appropriate network representations, use NetworkX to build and characterize networks, and uncover insights while working with real-world systems.

Who is this book for?

If you are a programmer or data scientist who wants to manipulate and analyze network data in Python, this book is perfect for you. Although prior knowledge of network science is not necessary, some Python programming experience will help you understand the concepts covered in the book easily.

What you will learn

  • Use Python and NetworkX to analyze the properties of individuals and relationships
  • Encode data in network nodes and edges using NetworkX
  • Manipulate, store, and summarize data in network nodes and edges
  • Visualize a network using circular, directed and shell layouts
  • Find out how simulating behavior on networks can give insights into real-world problems
  • Understand the ongoing impact of network science on society, and its ethical considerations
Estimated delivery fee Deliver to Germany

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 26, 2019
Length: 190 pages
Edition : 1st
Language : English
ISBN-13 : 9781789955316
Category :
Languages :
Concepts :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Estimated delivery fee Deliver to Germany

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Apr 26, 2019
Length: 190 pages
Edition : 1st
Language : English
ISBN-13 : 9781789955316
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 79.97
Python Machine Learning Cookbook
€29.99
Python Data Mining Quick Start Guide
€24.99
Network Science with Python and NetworkX Quick Start Guide
€24.99
Total 79.97 Stars icon

Table of Contents

13 Chapters
What is a Network? Chevron down icon Chevron up icon
Working with Networks in NetworkX Chevron down icon Chevron up icon
From Data to Networks Chevron down icon Chevron up icon
Affiliation Networks Chevron down icon Chevron up icon
The Small Scale - Nodes and Centrality Chevron down icon Chevron up icon
The Big Picture - Describing Networks Chevron down icon Chevron up icon
In-Between - Communities Chevron down icon Chevron up icon
Social Networks and Going Viral Chevron down icon Chevron up icon
Simulation and Analysis Chevron down icon Chevron up icon
Networks in Space and Time Chevron down icon Chevron up icon
Visualization Chevron down icon Chevron up icon
Conclusion Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(3 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Black May 09, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excelente book for beginners.The codes are really helpful
Amazon Verified review Amazon
David E. Battey Oct 01, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book does an excellent job of going from only a basic understanding of Python to all important aspects of NetworkX that are necessary for exploring and visualizing networks. There are excellent (and often humorous) examples, which were easy to run and understand. I used Jupyter Notebook, as recommended in the preface.I used this book for a Hackathon at work, and was able to quickly load up a data set that my team produces, which has different types of relationships between nodes, into a MultiDigraph. By adapting some of the examples in the book, I was able to create some pretty complex visualizations with very little effort.
Amazon Verified review Amazon
ajitB Mar 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
...makes this book the best book on use of NetworkX algo for understanding a wide variety of networks... social ones, economic ones, electrical ones ....and how to use many different metrics (e.g. Centrality) to understand what function these networks perform
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela