Task 2: Max and
min rainfall
The
“rainfall-monthly-total.csv” CSV file contains data on total monthly rainfall
in Singapore for every month between January 1982 and August 2019. Write a
Python program that loads the “rainfall-monthly-total.csv” CSV file into a 2D
array, and displays the month and total monthly rainfall data for the months
with maximum and minimum rainfall. The following figure shows an example of the
program output. It indicates that the maximum rainfall occurred in December 2006
with a value of 765.9 mm and the minimum rainfall occurred in February 2014
with a value of 0.2 mm.
Python codes |
|
Program output |
|
Task 3: Histogram
of temperature
The
“surface-air-temperature-monthly-mean.csv” CSV file contains data on mean
monthly temperature in Singapore for every month between January 1982 and
August 2019. Write a Python program that loads the
“surface-air-temperature-monthly-mean.csv” CSV file into a 2D array and plots a
histogram showing the frequency distribution of the temperature data. Add a
title and axis labels to the histogram. The following figure shows an example
of the program output:
Python codes |
|
Program output |
|
Task 4: Rainfall
vs temperature
The
“rainfall-monthly-total.csv” CSV file contains data on total monthly rainfall
in Singapore for every month between January 1982 and August 2019. The
“surface-air-temperature-monthly-mean.csv” CSV file contains data on mean
monthly temperature in Singapore for the same time period. Write a Python
program that loads the “rainfall-monthly-total.csv” and
“surface-air-temperature-monthly-mean.csv” CSV files into two 2D arrays and
plots total monthly rainfall as the y-variable against mean monthly temperature
as the x-variable on a scatterplot. Add a title and axis labels to the
scatterplot. The following figure shows an example of the program output:
Python codes |
|
Program output |
|
Get Free Quote!
376 Experts Online