ankane / ruby-polars

Blazingly fast DataFrames for Ruby
MIT License
852 stars 33 forks source link

Newbie Question on plotting #91

Closed ausangshukla closed 4 hours ago

ausangshukla commented 4 hours ago

df = Polars::DataFrame.new({"a" => ["one", "two", "three"], "b" => [1, 2, 3], "c" => ["group1", "group1", "group2"]}) df.plot("a", "b", type: "line", group: "c")

This works well

df = Polars::DataFrame.new({"a" => ["one", "two", "three"], "b" => [1, 2, 3], "c" => ["group1", "group1", "group2"], "d"=>[1,2,3,4,5] })

How to plot this, as we have an additional col d?

Thanks

ankane commented 4 hours ago

Hi @ausangshukla, plotting only supports 2 - 3 columns. You can either transform the data frame to get it to that number of columns, or for more advanced plotting, use Vega.rb directly.