SciRuby / daru

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

Fix reindex vector on argument error #470

Closed Yuki-Inoue closed 5 years ago

Yuki-Inoue commented 5 years ago

Currently, when one gives non-Daru::Index object to Daru::DataFrame#reindex_vectors method, exception of NoMethodError is raised instead of ArgumentError, the intended exception.

Reason is that when raiseing the exception, an non-existing variable of new_index is referenced. I think this was caused by simply copying the code from reindex method.

This PR fixes this and when non index is given, it properly throws ArgumentError.

Yuki-Inoue commented 5 years ago

ping @v0dro