mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-05 22:31:11 +08:00
Fix transpose2
This commit is contained in:
parent
9d6337df1c
commit
305489d591
@ -96,7 +96,7 @@ module Uplot
|
||||
# Note: How can I transpose different sized ruby arrays?
|
||||
# https://stackoverflow.com/questions/26016632/how-can-i-transpose-different-sized-ruby-arrays
|
||||
def transpose2(arr) # Should be renamed
|
||||
arr[0].zip(*arr[1..-1])
|
||||
Array.new(arr.map(&:length).max) { |i| arr.map { |e| e[i] } }
|
||||
end
|
||||
|
||||
def preprocess(input)
|
||||
|
Loading…
Reference in New Issue
Block a user