code: def sample_from_distribution(self, distribution, k, proportions=False):
          
          dist = self._get_column(distribution)
          total = sum(dist)
          assert total > 0 and np.all(dist >= 0), 'Counts or a distribution required'
          dist = dist/sum(dist)
          sample = np.random.multinomial(k, dist)
          if proportions:
              sample = sample / sum(sample)
          label = self._unused_label(self._as_label(distribution) + ' sample')
          return self.with_column(label, sample)
docs: Return a new table with the same number of rows and a new column.
          The values in the distribution column are define a multinomial.
          They are replaced by sample counts/proportions in the output.
  
          >>> sizes = Table(['size', 'count']).with_rows([
          ...     ['small', 50],
          ...     ['medium', 100],
          ...     ['big', 50],
          ... ])
          >>> sizes.sample_from_distribution('count', 1000) # doctest: +SKIP
          size   | count | count sample
          small  | 50    | 239
          medium | 100   | 496
          big    | 50    | 265
          >>> sizes.sample_from_distribution('count', 1000, True) # doctest: +SKIP
          size   | count | count sample
          small  | 50    | 0.24
          medium | 100   | 0.51
          big    | 50    | 0.25