Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Welcome to your first casestudy In this case study you have to scrape weather data from the website http://www.estesparkweather.net/archive_reports.php?date=200901 Scrape all the available attributes of
Welcome to your first casestudy
- In this case study you have to scrape weather data from the website"http://www.estesparkweather.net/archive_reports.php?date=200901"
- Scrape all the available attributes of weather data for each day from2009-01-01 to 2018-10-28
- Ignore records for missing days
- Represent the scraped data aspandas dataframeobject.
Dataframe specific deatails
- Expected column names (order dose not matter):
['Average temperature (F)', 'Average humidity (%)', 'Average dewpoint (F)', 'Average barometer (in)', 'Average windspeed (mph)', 'Average gustspeed (mph)', 'Average direction (deg)', 'Rainfall for month (in)', 'Rainfall for year (in)', 'Maximum rain per minute', 'Maximum temperature (F)', 'Minimum temperature (F)', 'Maximum humidity (%)', 'Minimum humidity (%)', 'Maximum pressure', 'Minimum pressure', 'Maximum windspeed (mph)', 'Maximum gust speed (mph)', 'Maximum heat index (F)']
- Each record in the dataframe corresponds to weather deatils of a given day
- Make sure the index column isdate-time format (yyyy-mm-dd)
- Perform necessary data cleaning and type cast each attributes to relevent data type
Saving the dataframe
- Once you are done with you scrapping save your dataframe as pickle file by name 'dataframe.pk'
Sample code to save pickle file
import pickle with open("dataframe.pk", "wb") as file: pickle.dump(<your_dataframe>, file)
Run the below cell to import necessary packages
- These packages should be sufficient to perform you task
- In case if you are looking are any other packages run!pip3 install --user with in a cell
import bs4
from bs4 import BeautifulSoup
import csv
import requests
import time
import pandas as pd
import urllib
import re
import pickle
#### Start you code here, you are free to add any number of cells
Step 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