code: def load_timeseries(path, group=None):
      
      ext = _os.path.splitext(path)[1]
      if ext == '.npy':
          data = _numpy.load(path)
      elif ext == '.txt':
          data = _numpy.loadtxt(path)
      elif ext == '.hdf':
          key = 'data' if group is None else group
          f = h5py.File(path)
          data = f[key][:]
          series = TimeSeries(data, delta_t=f[key].attrs['delta_t'],
                                    epoch=f[key].attrs['start_time'])
          f.close()
          return series
      else:
          raise ValueError('Path must end with .npy, .hdf, or .txt')
  
      if data.ndim == 2:
          delta_t = (data[-1][0] - data[0][0]) / (len(data)-1)
          epoch = _lal.LIGOTimeGPS(data[0][0])
          return TimeSeries(data[:,1], delta_t=delta_t, epoch=epoch)
      elif data.ndim == 3:
          delta_t = (data[-1][0] - data[0][0]) / (len(data)-1)
          epoch = _lal.LIGOTimeGPS(data[0][0])
          return TimeSeries(data[:,1] + 1j*data[:,2],
                            delta_t=delta_t, epoch=epoch)
      else:
          raise ValueError('File has %s dimensions, cannot convert to Array, \
                            must be 2 (real) or 3 (complex)' % data.ndim)
docs: Load a TimeSeries from a .hdf, .txt or .npy file. The
      default data types will be double precision floating point.
  
      Parameters
      ----------
      path: string
          source file path. Must end with either .npy or .txt.
  
      group: string
          Additional name for internal storage use. Ex. hdf storage uses
          this as the key value.
  
      Raises
      ------
      ValueError
          If path does not end in .npy or .txt.