Umamaheshwar
Umamaheshwar

Reputation: 1

Ruby, Daru, Nyaplot: Importing csv with dates into data frame

Trying to import a simple csv file with 2 columns, one date and another count.

df = Daru::DataFrame.from_csv('file.csv')

Now, if I try to plot:

irb(main):004:0> df.plot type: :line, x: 'Date', y: 'Count'
=> #<Nyaplot::Plot:0x0000000004234818 @properties={
  :diagrams => [
    #<Nyaplot::Diagram:0x00000000041eace0
      @properties = {
        :type => :line,
        :options => { :x => "Date", :y => "Count" },
        :data => "bde6ab93-4ef6-4d03-b9fd-bf2681d41f56"
      },
      @xrange = [ "6/1/2020", "6/9/2020" ],
      @yrange = [ 100, 228 ]>
    ],
    :options => {}
 }>

The dates are actually from 6/1/2020 to 6/30/2020. The y range is showing correctly.

Is Daru not recognizing dates correctly?

Upvotes: 0

Views: 170

Answers (0)

Related Questions