From: Joel Pearson Date: 2013-02-28T00:21:19+09:00 Subject: Re: Select "columns" from multidimensional array? Hah, I'm such an idiot. I've replaced the hideously inefficient compact_rows & columns with these: def compact_rows load to_a.reject { |ar| ar.all? { |el| el.nil? } } end def compact_columns load to_a.transpose.reject { |ar| ar.all? { |el| el.nil? } } end Much better :) -- Posted via http://www.ruby-forum.com/.