title: TypeError: unhashable type: 'dict' in Networkx random walk code that was previously working
body: <p>I had what I thought was a working random walk over a networkx node/edge graph.<br>
  I recently decided to update Anaconda using the navigator and then I came back to run my program again and all of a sudden it has stopped working.  Instead, I now get the error code:</p>
  
  <pre><code>runfile('C:/Users/e17/.spyder-py3/temp.py', wdir='C:/Users/e17/.spyder-py3')
  Traceback (most recent call last):
  
  File "&lt;ipython-input-64-51811f4d02fc&gt;", line 1, in &lt;module&gt;
  runfile('C:/Users/e17/.spyder-py3/temp.py', wdir='C:/Users/e17/.spyder-py3')
  
  File "C:\Users\e17\Anaconda3\lib\site- 
  packages\spyder\utils\site\sitecustomize.py", line 688, in runfile
  execfile(filename, namespace)
  
  File "C:\Users\e17\Anaconda3\lib\site- 
  packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
  exec(compile(f.read(), filename, 'exec'), namespace)
  
  File "C:/Users/e17/.spyder-py3/temp.py", line 19, in &lt;module&gt;
  if rc in NodesVisited:
  
  TypeError: unhashable type: 'dict'  
  </code></pre>
  
  <p>I had been using a while loop to fill a dictionary using the nodes that were visited during the random walk.  This was really nice in that the dictionary lent itself to a lot of downstream analysis.  I am now completely lost in how to fix this.  I gather that I need to provide a key for the dictionary, but I'm not quite sure how to populate the dictionary after providing the keys.  Anyway, here is the code:</p>
  
  <pre><code>import networkx as nx
  import random
  
  
  G_fb = nx.karate_club_graph()
  counter = 0
  loops = 1
  
  
  mylist = [];
  #run while loop for multiple attempts at random walker
  while loops &lt;= 1000:
  
      rc = random.choice(G_fb.nodes())
      NodesVisited = {}
  
      #Execute random walk
      while counter &lt;= 11:
          if rc in NodesVisited:
                  NodesVisited[rc] += 1
          else:
                  NodesVisited[rc] = 1
  
          Neighbors = G_fb.neighbors(rc)
          rc = random.choice(Neighbors)
          counter += 1
  
      #Organize the node list in most visited with decreasing order
      MostVisited = sorted(NodesVisited, key = NodesVisited.get,reverse = True)
  
      #Separate the top 10 most visited vertex
      top_top = MostVisited[:10]
  
      #create a list of most visited sites for plotting for each iteration  
      mylist.append(top_top)
  
  
      loops = loops + 1
      counter = 0
  print ('all done!')
  </code></pre>
  
  <p>Any help is much appreciated!</p>