def parse(data)
      # Assumes that each file has exactly the same structure
      result_df = nil
      Array(data).each_with_index do |filename, idx|
        filename = filename.to_s

        logger.info "Converting #{filename} to a dataframe"
        processed_filename = preprocess(filename)
        csv_df = Daru::DataFrame.from_csv processed_filename, @csv_options

        # Daru 0.1.4 doesn't add vectors if it's a headers-only file
        if csv_df.vectors.size == 0
          headers_df = Daru::DataFrame.from_csv processed_filename, @csv_options.merge(return_headers: true)
          csv_df = Daru::DataFrame.new([], order: headers_df.vectors.to_a)
        end

        csv_df[@filename_field] = Daru::Vector.new([filename] * csv_df.size, index: csv_df.index) if @filename_field
        if idx == 0
          result_df = csv_df
        else
          result_df = result_df.concat csv_df
        end
      end

      Remi::DataFrame.create(:daru, result_df)
    end
def parse(data)
      # Assumes that each file has exactly the same structure
      result_df = nil
      Array(data).each_with_index do |filename, idx|
        filename = filename.to_s

        logger.info "Converting #{filename} to a dataframe"
        processed_filename = preprocess(filename)
        csv_df = Daru::DataFrame.from_csv processed_filename, @csv_options

        # Daru 0.1.4 doesn't add vectors if it's a headers-only file
        if csv_df.vectors.size == 0
          headers_df = Daru::DataFrame.from_csv processed_filename, @csv_options.merge(return_headers: true)
          csv_df = Daru::DataFrame.new([], order: headers_df.vectors.to_a)
        end

        csv_df[@filename_field] = Daru::Vector.new([filename] * csv_df.size, index: csv_df.index) if @filename_field
        if idx == 0
          result_df = csv_df
        else
          result_df = result_df.concat csv_df
        end
      end

      Remi::DataFrame.create(:daru, result_df)
    end
Converts a list of filenames into a dataframe after parsing them
 according ot the csv options that were set
 @param data [Object] Extracted data that needs to be parsed
 @return [Remi::DataFrame] The data converted into a dataframe