nodes: 0, module; 1, function_definition; 2, function_name:load_seit_data; 3, parameters; 4, block; 5, identifier:directory; 6, default_parameter; 7, default_parameter; 8, dictionary_splat_pattern; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:# check that the number of frequencies matches the number of data files; 13, if_statement; 14, comment:# load data; 15, expression_statement; 16, for_statement; 17, expression_statement; 18, return_statement; 19, identifier:frequency_file; 20, string; 21, identifier:data_prefix; 22, string; 23, identifier:kwargs; 24, comment:"""Load sEIT data from data directory. This function loads data previously
      exported from reda using reda.exporters.crtomo.write_files_to_directory
  
      Parameters
      ----------
      directory : string
          input directory
      frequency_file : string, optional
          file (located in directory) that contains the frequencies
      data_prefix: string, optional
          for each frequency a corresponding data file must be present in the
          input directory. Frequencies and files are matched by sorting the
          frequencies AND the filenames, retrieved using glob and the
          data_prefix
  
      Returns
      -------
      df : pandas.DataFrame
          A DataFrame suitable for the sEIT container
      electrodes : None
          No electrode data is imported
      topography : None
          No topography data is imported
  
      """; 25, assignment; 26, assignment; 27, comparison_operator:frequencies.size != len(data_files); 28, block; 29, assignment; 30, pattern_list; 31, call; 32, block; 33, assignment; 34, expression_list; 35, string_content:frequencies.dat; 36, string_content:volt_; 37, identifier:frequencies; 38, call; 39, identifier:data_files; 40, call; 41, attribute; 42, call; 43, raise_statement; 44, identifier:data_list; 45, list; 46, identifier:frequency; 47, identifier:filename; 48, identifier:zip; 49, argument_list; 50, expression_statement; 51, expression_statement; 52, expression_statement; 53, identifier:df; 54, call; 55, identifier:df; 56, None; 57, None; 58, attribute; 59, argument_list; 60, identifier:sorted; 61, argument_list; 62, identifier:frequencies; 63, identifier:size; 64, identifier:len; 65, argument_list; 66, call; 67, identifier:frequencies; 68, identifier:data_files; 69, assignment; 70, assignment; 71, call; 72, attribute; 73, argument_list; 74, identifier:np; 75, identifier:loadtxt; 76, binary_operator:directory + os.sep + frequency_file; 77, call; 78, identifier:data_files; 79, identifier:Exception; 80, argument_list; 81, identifier:subdata; 82, call; 83, subscript; 84, identifier:frequency; 85, attribute; 86, argument_list; 87, identifier:pd; 88, identifier:concat; 89, identifier:data_list; 90, binary_operator:directory + os.sep; 91, identifier:frequency_file; 92, identifier:glob; 93, argument_list; 94, string; 95, identifier:load_mod_file; 96, argument_list; 97, identifier:subdata; 98, string; 99, identifier:data_list; 100, identifier:append; 101, identifier:subdata; 102, identifier:directory; 103, attribute; 104, binary_operator:directory + os.sep + data_prefix + '*'; 105, string_content:number of frequencies does not match number of data files; 106, identifier:filename; 107, string_content:frequency; 108, identifier:os; 109, identifier:sep; 110, binary_operator:directory + os.sep + data_prefix; 111, string; 112, binary_operator:directory + os.sep; 113, identifier:data_prefix; 114, string_content:*; 115, identifier:directory; 116, attribute; 117, identifier:os; 118, identifier:sep
code: def load_seit_data(directory, frequency_file='frequencies.dat',
                     data_prefix='volt_', **kwargs):
      """Load sEIT data from data directory. This function loads data previously
      exported from reda using reda.exporters.crtomo.write_files_to_directory
  
      Parameters
      ----------
      directory : string
          input directory
      frequency_file : string, optional
          file (located in directory) that contains the frequencies
      data_prefix: string, optional
          for each frequency a corresponding data file must be present in the
          input directory. Frequencies and files are matched by sorting the
          frequencies AND the filenames, retrieved using glob and the
          data_prefix
  
      Returns
      -------
      df : pandas.DataFrame
          A DataFrame suitable for the sEIT container
      electrodes : None
          No electrode data is imported
      topography : None
          No topography data is imported
  
      """
      frequencies = np.loadtxt(directory + os.sep + frequency_file)
      data_files = sorted(glob(directory + os.sep + data_prefix + '*'))
      # check that the number of frequencies matches the number of data files
      if frequencies.size != len(data_files):
          raise Exception(
              'number of frequencies does not match number of data files')
  
      # load data
      data_list = []
      for frequency, filename in zip(frequencies, data_files):
          subdata = load_mod_file(filename)
          subdata['frequency'] = frequency
          data_list.append(subdata)
      df = pd.concat(data_list)
      return df, None, None