SciRuby / daru

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

Daru::DataFrame#delete_rows #497

Open kojix2 opened 5 years ago

kojix2 commented 5 years ago

[enhancement / question]

It is strange that the delete_rows method is not implemented inDaru::DataFrame. Anything Iā€™m missing? Please let me know if you know how to delete multiple rows.

Shekharrajak commented 5 years ago

I think, we have delete_row method to delete a row by passing the index. But yes, deleting multiple rows is not exist.

MihirGH commented 5 years ago

@Shekharrajak In the purview of GSOC'19, I would like to contribute to DARu. I would like to start this by working on this issue. Can you please guide me for this? Thanks šŸ˜„

athityakumar commented 5 years ago

Hey @MihirGH!

For this specific case, you can have a look at this #delete_row method that is already implemented. You'll need to implement a similar #delete_rows method, that will call the existing #delete_row method multiple times.

You'll also have to write inline documentation & unit-tests: I'll probably mention more about them when you open a PR. šŸ˜„

MihirGH commented 5 years ago

What should the interface of delete_rows should be like? @athityakumar @Shekharrajak It should accept a start index and an end index (optional)? If the end index is not specified then it should just delete all the rows mentioned from the start index?

Shekharrajak commented 5 years ago

@MihirGH , I think the list of indexes (i.e. if the index is :a, :b, :c, :d , then user should be able to delete :b, :d so user has to pass [:b, :d]). It can or can't be order. What do you think ? Do you find similar API already present in daru?