In [1]:
require 'mikon'
Out[1]:
Out[1]:
In [3]:
arr1 = ([0]*100).map{rand-0.5}.reduce([0.0]){|memo, val| memo.push(memo.last + val); memo}
arr2 = ([0]*100).map{rand-0.5}.reduce([0.0]){|memo, val| memo.push(memo.last + val); memo}
df = Mikon::DataFrame.new({a: arr1, b: arr2})
Out[3]:
In [9]:
df.plot
Out[9]:
In [5]:
df.plot(type: :box)
Out[5]:
In [11]:
df.plot(type: :scatter, x: :a, y: :b, fill_by: :b, color: :seq)
Out[11]:
In [12]:
plot = df[:a].plot
plot.yrange([0, 25])
plot
Out[12]:
In [13]:
df[:a].plot(type: :line)
Out[13]:
In [9]:
df = Mikon::DataFrame.new([{a: 1, b: 5}, {a: 2, b: 2}, {a: 3, b: 4}])
Out[9]:
In [12]:
df[:a].to_a
Out[12]:
In [5]:
df.sort_by(false){a}
Out[5]:
In [6]:
df[:a]
Out[6]:
In [7]:
df.map{a}.to_darr.sorted_indices
Out[7]:
In [8]:
df = Mikon::DataFrame.new([[0, 1, 2], [0, 1, 2]])
Out[8]:
In [9]:
df = Mikon::DataFrame.new([[0, 1, 2], [0, 1, 2]], labels: [:a, :b], index: [1,2,3])
Out[9]:
In [10]:
require 'nyaplot'
Out[10]:
In [11]:
plot = Nyaplot::Plot.new
plot.add_with_df(df, :scatter, :a, :b)
plot
Out[11]: