Skip to content

Instantly share code, notes, and snippets.

@nateflink
Last active January 31, 2019 04:16
Show Gist options
  • Save nateflink/5fa1f4a3f967ccde5a28813cab50f70e to your computer and use it in GitHub Desktop.
Save nateflink/5fa1f4a3f967ccde5a28813cab50f70e to your computer and use it in GitHub Desktop.

Revisions

  1. nateflink revised this gist Jan 31, 2019. 1 changed file with 0 additions and 6 deletions.
    6 changes: 0 additions & 6 deletions temps.rb
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,6 @@
    #These are the results I found from the period of data on the MDNR site
    #https://www.dnr.state.mn.us/climate/twin_cities/listings.html







    #1970-01-18 max temp: -13.0 min temp: -28.0
    #1970-01-19 max temp: -10.0 min temp: -34.0
    #1970-01-20 max temp: -10.0 min temp: -24.0
  2. nateflink revised this gist Jan 31, 2019. 1 changed file with 97 additions and 0 deletions.
    97 changes: 97 additions & 0 deletions temps.rb
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,100 @@
    #These are the results I found from the period of data on the MDNR site
    #https://www.dnr.state.mn.us/climate/twin_cities/listings.html







    #1970-01-18 max temp: -13.0 min temp: -28.0
    #1970-01-19 max temp: -10.0 min temp: -34.0
    #1970-01-20 max temp: -10.0 min temp: -24.0
    #1970-01-21 max temp: -3.0 min temp: -29.0
    #1970-02-03 max temp: -5.0 min temp: -21.0
    #1971-02-07 max temp: -2.0 min temp: -20.0
    #1971-02-08 max temp: 0.0 min temp: -23.0
    #1971-02-09 max temp: 15.0 min temp: -21.0
    #1972-01-05 max temp: 15.0 min temp: -20.0
    #1972-01-14 max temp: -16.0 min temp: -26.0
    #1972-01-15 max temp: -14.0 min temp: -29.0
    #1972-01-25 max temp: -9.0 min temp: -20.0
    #1972-01-28 max temp: -7.0 min temp: -20.0
    #1972-02-07 max temp: 0.0 min temp: -24.0
    #1972-12-07 max temp: 1.0 min temp: -20.0
    #1973-01-06 max temp: 1.0 min temp: -20.0
    #1973-12-30 max temp: -3.0 min temp: -20.0
    #1973-12-31 max temp: -5.0 min temp: -24.0
    #1974-01-01 max temp: -12.0 min temp: -30.0
    #1974-01-02 max temp: 8.0 min temp: -21.0
    #1974-01-09 max temp: 1.0 min temp: -21.0
    #1974-01-11 max temp: -4.0 min temp: -20.0
    #1974-01-12 max temp: 0.0 min temp: -25.0
    #1974-02-04 max temp: 16.0 min temp: -20.0
    #1975-02-09 max temp: 2.0 min temp: -22.0
    #1976-12-31 max temp: 5.0 min temp: -23.0
    #1977-01-08 max temp: 4.0 min temp: -23.0
    #1977-01-09 max temp: -11.0 min temp: -32.0
    #1977-01-10 max temp: -2.0 min temp: -27.0
    #1977-01-11 max temp: -4.0 min temp: -31.0
    #1977-01-12 max temp: 0.0 min temp: -29.0
    #1977-01-15 max temp: -11.0 min temp: -22.0
    #1977-01-16 max temp: -12.0 min temp: -28.0
    #1977-01-17 max temp: 1.0 min temp: -25.0
    #1979-01-02 max temp: -2.0 min temp: -22.0
    #1979-01-11 max temp: 3.0 min temp: -28.0
    #1979-01-14 max temp: -7.0 min temp: -21.0
    #1979-02-05 max temp: 10.0 min temp: -27.0
    #1981-02-11 max temp: 1.0 min temp: -20.0
    #1982-01-07 max temp: 5.0 min temp: -20.0
    #1982-01-09 max temp: -10.0 min temp: -23.0
    #1982-01-10 max temp: 0.0 min temp: -26.0
    #1982-01-14 max temp: 0.0 min temp: -21.0
    #1982-01-16 max temp: -16.0 min temp: -23.0
    #1982-01-17 max temp: 8.0 min temp: -23.0
    #1982-01-24 max temp: -7.0 min temp: -21.0
    #1982-02-06 max temp: 16.0 min temp: -22.0
    #1983-12-18 max temp: -11.0 min temp: -24.0
    #1983-12-19 max temp: -11.0 min temp: -29.0
    #1983-12-20 max temp: 1.0 min temp: -22.0
    #1983-12-22 max temp: -12.0 min temp: -20.0
    #1983-12-23 max temp: -17.0 min temp: -25.0
    #1983-12-24 max temp: -10.0 min temp: -25.0
    #1984-01-18 max temp: -6.0 min temp: -25.0
    #1984-01-20 max temp: -12.0 min temp: -25.0
    #1985-01-19 max temp: -9.0 min temp: -25.0
    #1985-01-20 max temp: 8.0 min temp: -24.0
    #1985-01-31 max temp: -2.0 min temp: -20.0
    #1989-02-03 max temp: -13.0 min temp: -24.0
    #1989-12-20 max temp: -9.0 min temp: -20.0
    #1989-12-21 max temp: -9.0 min temp: -22.0
    #1990-12-23 max temp: -4.0 min temp: -24.0
    #1990-12-26 max temp: 2.0 min temp: -22.0
    #1994-01-15 max temp: -9.0 min temp: -25.0
    #1994-01-17 max temp: -7.0 min temp: -23.0
    #1994-01-18 max temp: -16.0 min temp: -27.0
    #1994-01-19 max temp: 1.0 min temp: -27.0
    #1994-01-30 max temp: 9.0 min temp: -20.0
    #1994-01-31 max temp: 2.0 min temp: -25.0
    #1996-01-30 max temp: -7.0 min temp: -20.0
    #1996-01-31 max temp: 2.0 min temp: -23.0
    #1996-02-01 max temp: -12.0 min temp: -27.0
    #1996-02-02 max temp: -17.0 min temp: -32.0
    #1996-02-03 max temp: -11.0 min temp: -26.0
    #1996-02-04 max temp: 4.0 min temp: -23.0
    #1996-12-25 max temp: -9.0 min temp: -22.0
    #1996-12-26 max temp: -3.0 min temp: -27.0
    #1998-01-13 max temp: 3.0 min temp: -23.0
    #1999-01-09 max temp: 3.0 min temp: -22.0
    #2004-01-30 max temp: -4.0 min temp: -24.0
    #2009-01-15 max temp: -6.0 min temp: -21.0
    #2009-01-16 max temp: 8.0 min temp: -22.0
    #2014-01-05 max temp: -2.0 min temp: -20.0
    #2014-01-06 max temp: -12.0 min temp: -23.0
    #2016-12-18 max temp: 2.0 min temp: -20.0
    #2019-01-29 max temp: -1.0 min temp: -25.0


    namespace :data do
    desc "TODO"
    task temps: :environment do
  3. nateflink created this gist Jan 31, 2019.
    41 changes: 41 additions & 0 deletions temps.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,41 @@
    namespace :data do
    desc "TODO"
    task temps: :environment do

    data = {}
    CSV.foreach("#{Rails.root}/DataDowloadCSV (4).csv", headers: true) do |row|
    h = row.to_h
    if h["Minimum Temperature degrees (F)"].to_f < -19.0
    puts h["Date"]+" max temp: "+h["Maximum Temperature degrees (F)"]+" min temp: "+h["Minimum Temperature degrees (F)"]
    end
    end
    CSV.foreach("#{Rails.root}/DataDowloadCSV (3).csv", headers: true) do |row|
    h = row.to_h
    if h["Minimum Temperature degrees (F)"].to_f < -19.0
    puts h["Date"]+" max temp: "+h["Maximum Temperature degrees (F)"]+" min temp: "+h["Minimum Temperature degrees (F)"]
    end
    end
    CSV.foreach("#{Rails.root}/DataDowloadCSV (2).csv", headers: true) do |row|
    h = row.to_h
    if h["Minimum Temperature degrees (F)"].to_f < -19.0
    puts h["Date"]+" max temp: "+h["Maximum Temperature degrees (F)"]+" min temp: "+h["Minimum Temperature degrees (F)"]
    end
    end

    CSV.foreach("#{Rails.root}/DataDowloadCSV (1).csv", headers: true) do |row|
    h = row.to_h
    if h["Minimum Temperature degrees (F)"].to_f < -19.0
    puts h["Date"]+" max temp: "+h["Maximum Temperature degrees (F)"]+" min temp: "+h["Minimum Temperature degrees (F)"]
    end
    end
    CSV.foreach("#{Rails.root}/DataDowloadCSV.csv", headers: true) do |row|
    h = row.to_h
    if h["Minimum Temperature degrees (F)"].to_f < -19.0
    puts h["Date"]+" max temp: "+h["Maximum Temperature degrees (F)"]+" min temp: "+h["Minimum Temperature degrees (F)"]
    end
    end


    end

    end