docs: def stack(recs, fields=None):
      """Stack common fields in multiple record arrays (concatenate them).
  
      Parameters
      ----------
      recs : list
          List of NumPy record arrays
      fields : list of strings, optional (default=None)
          The list of fields to include in the stacked array. If None, then
          include the fields in common to all the record arrays.
  
      Returns
      -------
      rec : NumPy record array
          The stacked array.
  
      """
      if fields is None:
          fields = list(set.intersection(
              *[set(rec.dtype.names) for rec in recs]))
          # preserve order of fields wrt first record array
          if set(fields) == set(recs[0].dtype.names):
              fields = list(recs[0].dtype.names)
      return np.hstack([rec[fields] for rec in recs])