Renaming nodes
This network looks good enough that we might be tempted to just call it a day on our cleaning efforts. However, there is a bit more that we need to do, especially for the White Rabbit, but also for a few other characters. I can see three nodes having to do with the White Rabbit:
the
White Rabbit
Rabbit
The
Rabbit Sends
If we rename all three of these nodes White Rabbit
, then they will be combined into a single node, and their edges will also be correctly connected. There are a few other nodes that should be renamed as well. Here is how to rename nodes:
relabel_mapping = {'Cheshire':'Cheshire Cat', 'Hatter':'Mad Hatter', 'Rabbit':'White Rabbit','William':'Father William', 'the White Rabbit':'White Rabbit', 'The Rabbit Sends':'White Rabbit', 'Bill':'Lizard Bill', 'Lizard':'Lizard Bill'...