docs: def sample(self, n):
      """ Samples data into a Pandas DataFrame.
      Args:
        n: number of sampled counts.
      Returns:
        A dataframe containing sampled data.
      Raises:
        Exception if n is larger than number of rows.
      """
  
      row_total_count = 0
      row_counts = []
      for file in self.files:
        with _util.open_local_or_gcs(file, 'r') as f:
          num_lines = sum(1 for line in f)
          row_total_count += num_lines
          row_counts.append(num_lines)
  
      names = None
      dtype = None
      if self._schema:
        _MAPPINGS = {
          'FLOAT': np.float64,
          'INTEGER': np.int64,
          'TIMESTAMP': np.datetime64,
          'BOOLEAN': np.bool,
        }
        names = [x['name'] for x in self._schema]
        dtype = {x['name']: _MAPPINGS.get(x['type'], object) for x in self._schema}
  
      skip_count = row_total_count - n
      # Get all skipped indexes. These will be distributed into each file.
      # Note that random.sample will raise Exception if skip_count is greater than rows count.
      skip_all = sorted(random.sample(range(0, row_total_count), skip_count))
      dfs = []
      for file, row_count in zip(self.files, row_counts):
        skip = [x for x in skip_all if x < row_count]
        skip_all = [x - row_count for x in skip_all if x >= row_count]
        with _util.open_local_or_gcs(file, 'r') as f:
          dfs.append(pd.read_csv(f, skiprows=skip, names=names, dtype=dtype, header=None))
      return pd.concat(dfs, axis=0, ignore_index=True)