SciRuby / daru

Data Analysis in RUby
BSD 2-Clause "Simplified" License
1.03k stars 139 forks source link

Merge on non default index drops index values #422

Closed baarkerlounger closed 6 years ago

baarkerlounger commented 6 years ago
2.3.3 :127 > df1
 => #<Daru::DataFrame(10x3)>
                 color director_n num_critic
    Avatar       Color James Came        723
 Pirates of      Color Gore Verbi        302
   Spectre       Color Sam Mendes        602
 The Dark K      Color Christophe        813
 Star Wars:        nil Doug Walke        nil
 John Carte      Color Andrew Sta        462
 Spider-Man      Color  Sam Raimi        392
   Tangled       Color Nathan Gre        324
 Avengers:       Color Joss Whedo        635
 Harry Pott      Color David Yate        375 
2.3.3 :128 > df2
 => #<Daru::DataFrame(10x3)>
            imdb_score aspect_rat movie_face
    Avatar         7.9       1.78      33000
 Pirates of        7.1       2.35          0
   Spectre         6.8       2.35      85000
 The Dark K        8.5       2.35     164000
 Star Wars:        7.1        nil          0
 John Carte        6.6       2.35      24000
 Spider-Man        6.2       2.35          0
   Tangled         7.8       1.85      29000
 Avengers:         7.5       2.35     118000
 Harry Pott        7.5       2.35      10000 
2.3.3 :129 > df1.merge(df2)
 => #<Daru::DataFrame(10x6)>
                 color director_n num_critic imdb_score aspect_rat movie_face
          0      Color James Came        723        7.9       1.78      33000
          1      Color Gore Verbi        302        7.1       2.35          0
          2      Color Sam Mendes        602        6.8       2.35      85000
          3      Color Christophe        813        8.5       2.35     164000
          4        nil Doug Walke        nil        7.1        nil          0
          5      Color Andrew Sta        462        6.6       2.35      24000
          6      Color  Sam Raimi        392        6.2       2.35          0
          7      Color Nathan Gre        324        7.8       1.85      29000
          8      Color Joss Whedo        635        7.5       2.35     118000
          9      Color David Yate        375        7.5       2.35      10000
info-rchitect commented 6 years ago

@rohitner can you please check if your fix will fix this bug?

baarkerlounger commented 6 years ago

Believe this can be closed now the above has been merged and possibly #429 also.