Created
March 3, 2023 19:03
-
-
Save TheCorp/71fd1ca4a3c53d318cca4c8b2f94c82f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.open('2021powerstatus.txt');nil | |
data = file.read;nil | |
data.length | |
data.split("\n").select{|x| x.include? "Diablo"}.count | |
raw_data = {"Diablo Canyon 2" => [], "Diablo Canyon 1" => []} | |
dc_analysis = data.split("\n").select{|x| x.include? "Diablo"};nil | |
dc_analysis = dc_analysis.reverse;nil | |
dc_analysis.each{|x| raw_data[x.split('|')[1]] << x.split('|').last.gsub("\r","").to_i};nil | |
p "2021 - DC1: avg CF: #{raw_data["Diablo Canyon 1"].mean}, DC1 days offline: #{raw_data["Diablo Canyon 1"].select{|x| x == 0}.count}, DC1 days less than 100 CF: #{raw_data["Diablo Canyon 1"].select{|x| x < 100}.count} " | |
p "2021 - DC2 avg CF #{raw_data["Diablo Canyon 2"].mean}, DC2 days offline: #{raw_data["Diablo Canyon 2"].select{|x| x == 0}.count}, DC2 days less than 100 CF: #{raw_data["Diablo Canyon 2"].select{|x| x < 100}.count}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment