WeatherDataAnalysis_Pandas-master

所属分类:OpenGL
开发工具:Visual Basic
文件大小:9840KB
下载次数:0
上传日期:2019-03-26 11:18:11
上 传 者here.senthil
说明:  code for weather data analysis in python

文件列表:
answers (0, 2017-03-10)
answers\Correlations.out (5449, 2017-03-10)
answers\MissingPrcpData.out (3192, 2017-03-10)
answers\YearHistogram.out (431, 2017-03-10)
answers\YearHistogram.png (14237, 2017-03-10)
answers\YearlyAverages.out (194827, 2017-03-10)
src (0, 2017-03-10)
src\Problem2.py (4032, 2017-03-10)
src\Problem4.py (2716, 2017-03-10)
src\__init__.py (0, 2017-03-10)
src\problem 1.py (1469, 2017-03-10)
src\problem 3.py (2759, 2017-03-10)
wx_data (0, 2017-03-10)
wx_data\USC00110072.txt (293355, 2017-03-10)
wx_data\USC00110187.txt (280989, 2017-03-10)
wx_data\USC00110338.txt (289224, 2017-03-10)
wx_data\USC00111280.txt (252261, 2017-03-10)
wx_data\USC00111436.txt (290088, 2017-03-10)
wx_data\USC00112140.txt (295839, 2017-03-10)
wx_data\USC00112193.txt (287631, 2017-03-10)
wx_data\USC00112348.txt (261387, 2017-03-10)
wx_data\USC00112483.txt (294246, 2017-03-10)
wx_data\USC00113335.txt (287604, 2017-03-10)
wx_data\USC00113879.txt (244998, 2017-03-10)
wx_data\USC00114108.txt (294192, 2017-03-10)
wx_data\USC00114198.txt (295002, 2017-03-10)
wx_data\USC00114442.txt (295839, 2017-03-10)
wx_data\USC00114823.txt (295083, 2017-03-10)
wx_data\USC00115079.txt (283527, 2017-03-10)
wx_data\USC00115326.txt (272079, 2017-03-10)
wx_data\USC00115515.txt (169317, 2017-03-10)
wx_data\USC00115712.txt (295839, 2017-03-10)
wx_data\USC00115768.txt (290115, 2017-03-10)
wx_data\USC00115833.txt (293382, 2017-03-10)
wx_data\USC00115901.txt (295839, 2017-03-10)
wx_data\USC00115943.txt (295839, 2017-03-10)
wx_data\USC00116446.txt (287658, 2017-03-10)
wx_data\USC00116526.txt (295002, 2017-03-10)
... ...

Overview -------- You have a folder,containing following three sub-folders: wx_data/ Weather data files yld_data/ Yield data files answers/ Empty folder where you will place your answers to the questions on this exam src/ Empty folder where you will place your source code that generated the answers Weather Data Description ------------------------ The wx_data folder has files containing weather data records from 1-Jan-1***5 to 31-Dec-2014. Each file corresponds to a particular weather station from Nebraska, Iowa, Illinois, Indiana, or Ohio. Each line in the file contains 4 records separated by tabs: 1. The date (YYYYMMDD format) 2. The maximum temperature for that day (in tenths of a degree Celsius) 3. The minimum temperature for that day (in tenths of a degree Celsius) 4. The amount of precipitation for that day (in tenths of a millimeter) Missing values are indicated by the value -9999. Yield Data Description ---------------------- The yld_data folder has a single file, US_corn_grain_yield.txt, containing a table of the total harvested corn grain yield in the United States measured in 1000s of megatons for the years 1***5 - 2014. Problem 1 --------- Write a software program to calculate for each weather data file the number of days in which the maximum temperature and minimum temperature data are present but the precipitation data is missing. The program should create one line of output for each of the weather data files. Each line of output should have the filename (e.g. USC00339312.txt) and the number of days you have identified. Separate the columns by a tab. Write the output in ascending order by filename and store it in the file MissingPrcpData.out in the answers folder. Problem 2 --------- Write a software program to calculate the following values for every year for every station, ignoring missing data: Average maximum temperature (in degrees Celsius) Average minimum temperature (in degrees Celsius) Total accumulated precipitation (in centimeters) The program should create one line of output for each of the weather stations. Each line of output should have the following information separated by tabs: the filename, the year, the average maximum temperature to 2 decimal places, the average minimum temperature to 2 decimal places, and the total accumulated precipitation to 2 decimal places. If a value cannot be calculated assign a value of -9999.00 when writing your output. Store your results in the file YearlyAverages.out in the answers folder, sorted in ascending order by filename. Problem 3 --------- Write a software program that tabulates how often each year from 1***5-2014 had the highest average maximum temperature, highest average minimum temperature, and highest total accumulated precipitation from the set of weather stations. Use the results of Problem 2 as input to your program. The resulting output should indicate how frequently a given year had the highest values for the 167 weather stations present in wx_data. Output should be written to the file YearHistogram.out in the answers folder. The file should contain 4 columns: the year, the count of how many weather stations had that year as the highest annual average maximum temperature, a count of how many weather stations had that year as the highest annual average minimum temperature, and a count of how many weather stations had that year as the highest total annual precipitation. Separate each column by tabs and sort the output in ascending order by year. In addition, create a histogram of the output and save the result as YearHistogram.png. Problem 4 --------- Use the annual average maximum temperature, annual average minimum temperature, and total annual precipitation results from Problem 2 and calculate the Pearson correlation between these variables and the grain yield data stored in US_corn_grain_yield.txt. Output the correlations for every station. Write your output to the file Correlations.out in the answers folder. The columns of the file should be separated by tabs and will contain the filename of the weather station (e.g. USC00339312.txt) and the three correlation values to 2 decimal places. Sort the output in ascending order by filename.

近期下载者

相关文件


收藏者