class_docstr: A class representing a collection of discrete distributions.
  
  Parameters
  ----------
  xk : 2d array_like
      The support points, should be non-decreasing within each
      row.
  pk : 2d array_like
      The probabilities, should sum to one within each row.
  
  Notes
  -----
  Each row of `xk`, and the corresponding row of `pk` describe a
  discrete distribution.
  
  `xk` and `pk` should both be two-dimensional ndarrays.  Each row
  of `pk` should sum to 1.
  
  This class is used as a substitute for scipy.distributions.
  rv_discrete, since that class does not allow non-integer support
  points, or vectorized operations.
  
  Only a limited number of methods are implemented here compared to
  the other scipy distribution classes.
class_docstr_tok: ["A","class","representing","a","collection","of","discrete","distributions",".","Parameters","--","--","--","--","--","xk",":","2d","array_like","The","support","points",",","should","be","non-decreasing","within","each","row",".","pk",":","2d","array_like","The","probabilities",",","should","sum","to","one","within","each","row",".","Notes","--","--","-","Each","row","of","`","xk","`",",","and","the","corresponding","row","of","`","pk","`","describe","a","discrete","distribution",".","`","xk","`","and","`","pk","`","should","both","be","two-dimensional","ndarrays",".","Each","row","of","`","pk","`","should","sum","to","1",".","This","class","is","used","as","a","substitute","for","scipy.distributions",".","rv_discrete",",","since","that","class","does","not","allow","non-integer","support","points",",","or","vectorized","operations",".","Only","a","limited","number","of","methods","are","implemented","here","compared","to","the","other","scipy","distribution","classes","."]
docstr: Returns a random sample from the discrete distribution.
  
  A vector is returned containing a single draw from each row of
  `xk`, using the probabilities of the corresponding row of `pk`
  
  Parameters
  ----------
  n : not used
      Present for signature compatibility
docstr_tok: ["Returns","a","random","sample","from","the","discrete","distribution",".","A","vector","is","returned","containing","a","single","draw","from","each","row","of","`","xk","`",",","using","the","probabilities","of","the","corresponding","row","of","`","pk","`","Parameters","--","--","--","--","--","n",":","not","used","Present","for","signature","compatibility"]
code: def rvs(self, n=None):
      """
      Returns a random sample from the discrete distribution.
  
      A vector is returned containing a single draw from each row of
      `xk`, using the probabilities of the corresponding row of `pk`
  
      Parameters
      ----------
      n : not used
          Present for signature compatibility
      """
  
      n = self.xk.shape[0]
      u = np.random.uniform(size=n)
  
      ix = (self.cpk < u[:, None]).sum(1)
      ii = np.arange(n, dtype=np.int32)
      return self.xk[(ii, ix)]
  
imports: import numpy
  from statsmodels.base import model
  import statsmodels.base.model
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.compat.pandas import Appender
label_desc: Use image node_id 2 for calling the rv_discrete_float obj's underlying member method code with example usage: obj.rvs(n) and returns: self