How can one conditionally remove whole columns from a 2D array in Ruby?
I have several large csv files with thousands of columns that I need to import and then delete all columns based on columns. Is there an easy way to handle this in Ruby?
I could transpose the data and then just delete the lines, but I was wondering if there is a more syntactically sweet way to do this.
+1
source to share
4 answers
Snapshot in the dark, but if the criteria are simple enough and you can somehow sample the data to see which columns you need to remove, perhaps you can skip importing the columns in the first place, if at all possible it should be faster than slicing, which is is the way to go differently.
0
source to share