6. The following questions refer to the data provided in the report "Day-by-day ridership num bers" ("MTA data.pdf") fro
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
6. The following questions refer to the data provided in the report "Day-by-day ridership num bers" ("MTA data.pdf") fro
Thank you for your help!
6. The following questions refer to the data provided in the report "Day-by-day ridership num bers" ("MTA data.pdf") from the New York City Metropolitan Transportation Authority (MTA). Note that while you now have the skills to answer all questions, we have not neces- sarily given you the explicit code you will need for all questions. (a) Create an array called myarray that contains numeric data for the seven most recently reported days (in order from most recent to longer ago) of total estimated ridership data on the NYC subways, including the Staten Island Railway. Please create this array manually (i.e., you do not need to import any data for this homework). (b) Show that you have indeed created an array by evaluating its type. (c) Use the NumPy package to calculate the mean of myarray and show the result. (d) Convert the mean you just generated into an int without simply retyping all of the numbers in the mean you just calculated.
(e) Create a second array called secondarray that contains the remaining three numeric data points for the total estimated ridership data from the "Subway including Staten Island" table, again in order from most recent to longest ago. As with question 8(a), please do this manually (do not import data). (f) Use the append command to create a new, third array called fullarray that contains all ten total estimated ridership numeric observations from most recent to longest ago and show all the values of fullarray. (g) Recreate the first three lines of the "Subway including Staten Island" table exactly (it must include all the characters present in the original table) by using a dictionary and then turning it into a pandas DataFrame. (h) What is the unit of analysis in this dataset you've just created? (i) Find the data types of each of the columns. In order to conduct further calculations (such as mean) what would you need to do in order to carry out those operations?