Method: Daru::DataFrame#concat

Defined in:
lib/daru/dataframe.rb

#concat(other_df) ⇒ Object

Concatenate another DataFrame along corresponding columns. If columns do not exist in both dataframes, they are filled with nils



1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/daru/dataframe.rb', line 1226

def concat other_df
  vectors = (@vectors.to_a + other_df.vectors.to_a).uniq

  data = vectors.map do |v|
    get_vector_anyways(v).dup.concat(other_df.get_vector_anyways(v))
  end

  Daru::DataFrame.new(data, order: vectors)
end