This new assignment consists of two technical products:
- Deliverable 1: Scrape titles and preview text from Mars news articles.
- Deliverable 2: Scrape and analyze Mars weather data.
-
I used Splinter to visit https://static.bc-edx.com/data/web/mars_news/index.html.
-
I created a Beautiful Soup object and used it to extract the text elements from the website.
-
I stored the article titles and preview texts of the news articles in a title-and-preview pair in a Python list of dictionaries, giving each dictionary two keys:
title
andpreview
.
- I used Splinter to visit https://static.bc-edx.com/data/web/mars_facts/temperature.html.
- I created a Beautiful Soup object and used it to extract the data in the HTML table.
- I assembled the data into a Pandas DataFrame, with the columns having the same headings as the table on the website.
- These are the column headings:
id
: the identification number of a single transmission from the Curiosity roverterrestrial_date
: the date on Earthsol
: the number of elapsed sols (Martian days) since Curiosity landed on Marsls
: the solar longitudemonth
: the Martian monthmin_temp
: the minimum temperature, in Celsius, of a single Martian day (sol)pressure
: The atmospheric pressure at Curiosity's location
- Next, I examined the data types that are currently associated with each column and casted
id
,sol
,ls
, andmonth
to integer,terrestial_date
to datetime, andmin_temp
andpressure
columns to float. - Analyzed the dataset by using Pandas functions to answer the following questions:
- How many months exist on Mars?
- A: 12 months
- How many Martian (and not Earth) days worth of data exist in the scraped dataset?
- A: 12 months
- What are the coldest and the warmest months on Mars (at the location of Curiosity)?
- To answer this question:
- Find the average the minimum daily temperature for all of the months.
- Plot the results as a bar chart.
- A: On average, the third month has the coldest minimum temperature on Mars, and the eighth month is the warmest.
- To answer this question:
- Which months have the lowest and the highest atmospheric pressure on Mars?
- To answer this question:
- Find the average the daily atmospheric pressure of all the months.
- Plot the results as a bar chart.
- A: Atmospheric pressure is, on average, lowest in the sixth month and highest in the ninth.
- To answer this question:
- About how many terrestrial (Earth) days exist in a Martian year?
- A: The distance from peak to peak is roughly 1425-750, or 675 days. A year on Mars appears to be about 675 days from the plot. Internet search confirms that a Mars year is equivalent to 687 earth days.
- How many months exist on Mars?