title: Gurobi in Python: best way to read csv file
body: <p>I'm learning how to solve combinatorial optimization problems in Gurobi using Python. I would like to know what is the best option to read a csv file to use the data as model parameters. I'm using 'genfromtxt' to read the csv file, but I'm having difficulties in using it for constraint construction (Gurobi doesn't support this type - see error). </p>
  
  <p>Here my code and error message, my_data is composed by 4 columns: node index, x coordinate, y coordinate and maximum degree.</p>
  
  <pre><code>from gurobipy import *
  from numpy import genfromtxt
  import math
  
  # Read data from csv file
  my_data = genfromtxt('prob25.csv', delimiter=',')
  
  # Number of vertices
  n = len(my_data)
  
  # Function to calculate euclidean distancces
  dist = {(i,j) :
      math.sqrt(sum((my_data[i][k]-my_data[j][k])**2 for k in [1,2]))
      for i in range(n) for j in range(i)}
  
  # Create a new model
  m = Model("dcstNarula")
  
  # Create variables
  
  vars = m.addVars(dist.keys(), obj=dist, vtype=GRB.BINARY, name='e')
  for i,j in vars.keys():
      vars[j,i] = vars[i,j] # edge in opposite direction
  
  m.update()
  
  # Add degree-b constraint
  m.addConstrs((vars.sum('*',j) &lt;= my_data[:,3]
               for i in range(n)), name='degree')
  
  GurobiError: Unsupported type (&lt;type 'numpy.ndarray'&gt;) for LinExpr addition argument
  </code></pre>
  
  <p>First two lines of data</p>
  
  <pre><code>1,19.007,35.75,1
  2,4.4447,6.0735,2
  </code></pre>