Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Download the nycflights 1 3 _ weather.csv . gz data file from our unit site ( Learning Resources - > Data ) . It gives

Download the nycflights13_weather.csv.gz data file from our unit site (Learning Resources -> Data).
It gives the hourly meteorological data for three airports in New York: LGA, JFK, and EWR for the whole
year of 2013. The columns are:
origin weather station: LGA, JFK, or EWR,
year, month, day, hour time of recording,
temp, dewp temperature and dew point in degrees Fahrenheit,
humid relative humidity,
wind_dir, wind_speed, wind_gust wind direction (in degrees), speed and gust speed (in mph),
precip precipitation, in inches,
pressure sea level pressure in millibars,
visib visibility in miles,
time_hour date and hour (based on the year, month, day, hour fields) formatted as YYYY-mmdd
HH:MM:SS (actually, YYYY-mm-dd HH:00:00). However, due to a bug in the dataset, the data in this
column are (incorrectly!) shifted by 1 hour. Do not rely on it unless you manually correct it.
Then, create a single Jupyter/IPython notebook (see the Artefacts section below for all the requirements),
where you perform what follows.
1. Convert all columns so that they use metric (International System of Units, SI) or derived units:
temp and dewp to Celsius, precip to millimetres, visib to metres, as well as wind_speed and
wind_gust to metres per second. Replace the data in-place (overwrite existing columns with new
ones).
2. Compute daily mean wind speeds for the LGA airport (~365 total speed values, for each day separately;
you can, for example, group the data by year, month, and day at the same time).
3. Present the daily mean wind speeds at LGA (~365 aforementioned data points) in a single plot, e.g.,
using the matplotlib.pyplot.plot function. The x-axis labels should be human-readable and
intuitive (e.g., month names or dates). Reference result:
1
2013-012013-032013-052013-072013-092013-112014-01
day
2
4
6
8
10
daily average wind speed [m/s] at LGA
4. Identify the ten windiest days at LGA (dates and the corresponding mean daily wind speeds).
Reference result:
## wind_speed
## date
## 2013-11-2411.317783
## 2013-01-3110.717598
## 2013-02-1710.010236
## 2013-02-219.192903
## 2013-02-189.174264
## 2013-03-149.109958
## 2013-11-288.938477
## 2013-05-268.852736
## 2013-05-258.766995
## 2013-02-208.659819
5. Compute the monthly mean wind speeds for all the three airports.
There is one obvious outlier amongst the observed wind speeds. Locate it (programmatically, do
not hardcode the date/day/row number) and replace it with np.nan (NaN) before computing the
means.
6. Draw the monthly mean wind speeds for the three airports on the same plot (three curves of different
colours). Add a readable legend. Reference result:
2
2013-012013-032013-052013-072013-092013-11
month
3.5
4.0
4.5
5.0
5.5
6.0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions