title: networkx calculating numeric assortativity requires int?
body: <p>I am trying to use networkx to calculate numeric assortativity based on a numeric attribute that I set to nodes. My node attributes are floats.  When I call the assortativity function:</p>
  
  <pre><code>assort = nx.numeric_assortativity_coefficient(G,'float_attr')
  </code></pre>
  
  <p>I got the following errors.</p>
  
  <pre><code>File "/some dir.../networkx/algorithms/assortativity/correlation.py", line 229, in numeric_assortativity_coefficient
  a = numeric_mixing_matrix(G,attribute,nodes)
  File "/some dir.../networkx/algorithms/assortativity/mixing.py", line 193, in numeric_mixing_matrix
  mapping=dict(zip(range(m+1),range(m+1)))
  TypeError: range() integer end argument expected, got float.
  </code></pre>
  
  <p>I checked the <a href="https://networkx.github.io/documentation/latest/reference/generated/networkx.algorithms.assortativity.numeric_assortativity_coefficient.html#networkx.algorithms.assortativity.numeric_assortativity_coefficient" rel="nofollow">documentation page</a> of networkx assortativity algorithm and it did not say the numeric attributes have to be int. Anyone knows if that's required?</p>
  
  <p>BTW, I used the same network and a gender attribute (set to 0 and 1) to calculate both the attribute and the numeric assortativity. I had no problem with that. So it seems that the problem is with the int/float type of the node attribute.</p>