In [1]:
%matplotlib inline
import numpy as np
import pandas as pd
import networkx as nx

In [2]:
G=nx.Graph()

In [9]:
edges = pd.read_csv('../data/edges.csv')

In [12]:
nodes.head(3)


Out[12]:
Unnamed: 0 users
0 0 NaN
1 1 0x0000000000000000000000000000000000000000
2 2 0x0000000000000000000000000000000000000001

In [13]:



---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-bd11dcd30417> in <module>()
      1 for row in nodes.iterrows():
----> 2     G.add_node(row[1])

/usr/local/lib/python2.7/dist-packages/networkx/classes/graph.pyc in add_node(self, n, attr_dict, **attr)
    458                 raise NetworkXError(
    459                     "The attr_dict argument must be a dictionary.")
--> 460         if n not in self.node:
    461             self.adj[n] = self.adjlist_dict_factory()
    462             self.node[n] = attr_dict

/usr/local/lib/python2.7/dist-packages/pandas/core/generic.pyc in __hash__(self)
    804     def __hash__(self):
    805         raise TypeError('{0!r} objects are mutable, thus they cannot be'
--> 806                         ' hashed'.format(self.__class__.__name__))
    807 
    808     def __iter__(self):

TypeError: 'Series' objects are mutable, thus they cannot be hashed

In [ ]: