code: def load_file(path):
      '''Load a txt data file'''
      path = pathlib.Path(path)
      data = path.open().readlines()
      # remove comments and empty lines
      data = [l for l in data if len(l.strip()) and not l.startswith("#")]
      # determine data shape
      n = len(data)
      m = len(data[0].strip().split())
      res = np.zeros((n, m), dtype=np.dtype(float))
      # write data to array, replacing comma with point decimal separator
      for ii in range(n):
          res[ii] = np.array(data[ii].strip().replace(",", ".").split(),
                             dtype=float)
      return ref load_file(path):
      '''Load a txt data file'''
      path = pathlib.Path(path)
      data = path.open().readlines()
      # remove comments and empty lines
      data = [l for l in data if len(l.strip()) and not l.startswith("#")]
      # determine data shape
      n = len(data)
      m = len(data[0].strip().split())
      res = np.zeros((n, m), dtype=np.dtype(float))
      # write data to array, replacing comma with point decimal separator
      for ii in range(n):
          res[ii] = np.array(data[ii].strip().replace(",", ".").split(),
                             dtype=float)
      return res
docs: Load a txt data file