在紅寶石多個陣列我有以下的數組:拆分陣列成基於索引
array = [["Group EX (Instructor)", 0.018867924528301886], ["Personal Reasons", 0.018867924528301886]]
,我需要拆分此陣列起來,動態地,成兩個陣列:
text_array = ["Group EX (Instructor)", "Personal Reasons"]
number_array = [0.018867924528301886,0.018867924528301886]
我目前正在這樣做,這是不正確的:
array.each do |array|
text_array << array[0]
number_array << array[1]
end