class_docstr: Bipartite graph class
  
  A graph for which there are two types of nodes, such that
  edges can exist only between nodes of type 1 and type 2 (not within)
  fields of this class:
  V (int, > 0) the number of type 1 vertices
  W (int, > 0) the number of type 2 vertices
  E: (int) the number of edges
  edges: array of shape (self.E, 2) reprensenting pairwise neighbors
  weights, array of shape (self.E), +1/-1 for scending/descending links
class_docstr_tok: ["Bipartite","graph","class","A","graph","for","which","there","are","two","types","of","nodes",",","such","that","edges","can","exist","only","between","nodes","of","type","1","and","type","2","(","not","within",")","fields","of","this","class",":","V","(","int",",",">","0",")","the","number","of","type","1","vertices","W","(","int",",",">","0",")","the","number","of","type","2","vertices","E",":","(","int",")","the","number","of","edges","edges",":","array","of","shape","(","self.E",",","2",")","reprensenting","pairwise","neighbors","weights",",","array","of","shape","(","self.E",")",",","+1\/-1","for","scending\/descending","links"]
docstr: Set weights `weights` to edges
  
  Parameters
  ----------
  weights, array of shape(self.V): edges weights
docstr_tok: ["Set","weights","`","weights","`","to","edges","Parameters","--","--","--","--","--","weights",",","array","of","shape","(","self.V",")",":","edges","weights"]
code: def set_weights(self, weights):
      """Set weights `weights` to edges
  
      Parameters
      ----------
      weights, array of shape(self.V): edges weights
      """
      if np.size(weights) != self.E:
          raise ValueError("The weight size is not the edges size")
      else:
          self.weights = np.reshape(weights, (self.E))
  
file_path: nipy/nipy/algorithms/graph/bipartite_graph.py
imports: import numpy
label_desc: Use image node_id 2 for calling the BipartiteGraph obj's underlying member method code with example usage: obj.set_weights(weights) without return types