how can i fix AttributeError: 'dict_values' object has no attribute 'count'?
<p>here is my <a href="http://pastebin.com/tzPpqE97" rel="nofollow">code</a> and the text file is <a href="http://www.dropbox.com/s/2bklv7p4ylq8wur/web-graph.zip?dl=0http://" rel="nofollow">here</a></p>

<pre><code>import networkx as nx
import pylab as plt

webg = nx.read_edgelist('web-graph.txt',create_using=nx.DiGraph(),nodetype=int)
in_degrees = webg.in_degree()
in_values = sorted(set(in_degrees.values()))
in_hist = [in_degrees.values().count(x)for x in in_values]
</code></pre>

<p>I want to plot degree distribution web graph 
how can i change dict to solve?</p>

<p>If you want to count dictionary values you can do it like this:</p>

<pre><code>len(list(dict.values()))
</code></pre>

<p>same method works for keys</p>

<pre><code>len(list(dict.keys()))
</code></pre>

<p>Also keep in mind if you want to get all keys or values in list just use <code>list(dict.values())</code></p>

python python-3.x networkx