Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python3 Given this information, how could one take the amount from each day and print out the total for each month? It's beyond my knowledge
Python3
Given this information, how could one take the amount from each day and print out the total for each month? It's beyond my knowledge and I would absolutely love to know how to do this.
Sunspots.csy datafile You are provided an input file called sunspots.csv. This is a comma separated value file. The first value is the year, then the month, then day. The 4th value is a decimal form of the year, which we don't need. The 5th value is the number of sunspots observed. A-1 indicates no observation and will be assumed as zero for our purposes, there may also be non-numeric characters in the field, which can also be counted as zero. ( elegantly handle the exceptions) The 6th column will not be used. You can use the .csy module for reading through the file. Example 1818,01,01,1818.004, ?,1 1818,01,02,1818.007,?,1 1818,01,03,1818.010,?,1 1818,01,04,1818.012, ?,1 1818,01,05,1818.015, ?,1 1818,01,06,1818.018, ?,1 1818,01,07,1818.021, ?,1 1818,01,08,1818.023, 39,1 1818,01,09,1818.026, ?,1 1818,01,10,1818.029,?,1 1818,01,11,1818.031, ?,1 1818,01,12,1818.034, ?,1 Monthtotal.csv datafile The first file you will output will be the Monthtotal.csv file. It should contain 3 columns. First being the year, then the month and then the total sunspots observed for that month Example output 1818,01,279 1818,02,314Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started