daru icon indicating copy to clipboard operation
daru copied to clipboard

`add_vector` should not require name of named Vector.

Open kojix2 opened this issue 6 years ago • 1 comments

EDIT (@v0dro): changing this issue to include only the add_vector part.

Vectors 's @name can be useful. But daru does not seem to use its features.

For example 

df = Daru::DataFrame.new(a: [1,2,3], b: [4,5,6])
v = df.a
df2 = Daru::DataFrame.new(c: [7,8,9], d: [10,11,12])
df2. add_vector "a", v

The vector knows its name, but the add_vector method requires the name of the vector.

(pseudocode)

df1 = DataFrame.new
v = df["some_vector"]
df2 = DataFrame
df2. add v

The expected behaviour should be that add_vector should pick up the name of the vector by itself.

kojix2 avatar Apr 28 '19 06:04 kojix2

This can be separated into two issues:

  1. DataFrame cannot use the name value since it is an internal usage parameter.
  2. add_vector should have an option for not specifying the name of the vector if it already exists within the Vector.

About 1, it cannot be helped since we use the name internally but add_vector is a legit usecase I will amend your issue accordingly.

v0dro avatar May 30 '20 05:05 v0dro