Book Image

IPython Interactive Computing and Visualization Cookbook

By : Cyrille Rossant
Book Image

IPython Interactive Computing and Visualization Cookbook

By: Cyrille Rossant

Overview of this book

Table of Contents (22 chapters)
IPython Interactive Computing and Visualization Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Analyzing a social network with NetworkX


In this recipe, we will show how to analyze social data in Python. Social data is generated by people's activity on social networks such as Facebook, Twitter, Google+, GitHub, and others.

In this recipe, we will analyze and visualize a Twitter user's social network with NetworkX.

Getting ready

First, you need to install the Twitter Python package. You can install it with pip install twitter. You'll find more information at https://pypi.python.org/pypi/twitter.

Then, you need to obtain authentication codes in order to access your Twitter data. The procedure is free. In addition to a Twitter account, you also need to create an Application on the Twitter Developers website at https://dev.twitter.com/apps. Then, you will be able to retrieve the OAuth authentication codes that are required for this recipe.

You need to create a twitter.txt text file in the current folder with the four private authentication keys. There must be one key per line, in the following...