Submit the following programs via the honors section of Gradescope:
Throughout the semester, we will focus on the upcoming L-train tunnel closure:
For 15 months starting in April of 2019, all MTA New York City Transit (NYCT) L train service will be suspended across the East River and within Manhattan to repair damage caused by Superstorm Sandy. The L train will still run within Brooklyn, serving all stops. The temporary closure will directly affect 275,000 of the L Train's 400,000 daily riders, and indirectly affect many more throughout the city. All alternative transit services and traffic management policies are temporary for the duration of the L train closure.and its effects on nearby neighborhoods in New York City.
To begin, pick a neighborhood (i.e. choose one along the L-train and sign up on Blackboard). Create a single page summary of your neighborhood that includes:
Note: upload a .pdf to the assignment HC 1. in the honors section of Gradescope. Unlike the Python code, it is not automatically graded.
FiveThirtyEight analyzed the cost of commuting in terms of the extra New Yorkers were willing to pay to lessen their commute. StreetEasy did a similar analysis, measuring from given subway stops (and includes a lovely Tableaux map-- scroll down).
How will the L-train tunnel closure affect housing prices? To narrow down the analysis, we will focus on the distance to two landmarks: Empire State Building (as a proxy for midtown) and Federal Hall (for the financial district) and 3 locations. You may find WNYC Transit Time or Google Maps useful, as well as CityMapper. Pick, at random, three rentals in your neighborhood.
Using the analysis from FiveThirtyEight, predict what the tunnel closure will do to the prices of your three chosen apartments. Justify your answer.
Submit a .pdf file analyzing the time and cost of commuting of your neighborhood. You should use complete sentences and justify your answers with data.
The MTA predicts that 275,000 daily riders will be directly affected by the L-train tunnel closure. How can that be replaced by existing transit options? Submit a single page (.pdf file) containing the following information:
Submit a .pdf file analyzing the density and zoning of your neighborhood. You should use complete sentences and justify your answers with data from the readings.
Working in pairs or triples, design a ranking for most desirable features of a neighborhood.
There are multiple rankings of New York City Neighborhoods. For example,
Submit a .pdf file containing your assessment of the rankings and the three most desirable qualities. You should use complete sentences, compare and contrast the rankings above, and justify the three qualities that your group thought most important.
Urban planner, Jeff Speck, argues that if a city succeeds at being walkable, it excels at having a high quality of life (see his TED talk).
Working in pairs or triples, analyze his argument in terms of five neighborhoods in New York City and the ranking you determined in HC 4. For five of the neighborhoods chosen by class (1-page summaries from HC 1 are available on Blackboard), determine the following:
Does your ranking concur with ranking the neighborhoods by walkability? Justify your answer.
Submit a .pdf file analyzing the your rankings and walkability of five neighborhoods chosen for the class. You should use complete sentences and justify your answers with data.
Using the geoJSON mapper (see geoJSON notes), make a JSON file that includes the following features:
Commit to github, and view using the github preview button (you should see you encoding rendered graphically on a map).
Submit a screenshot of your map as a .pdf file.
For this program, we will create a highlighted map around your station, with the region within about a 1/4 mile box at full brightness, the region that outside that box at 50% brightness.
To do this:
Submit your answer as a .pdf file to gradescope.
In Lab 7 (24 October), we introduced
NYC OpenData. As part of the OpenData initiative, the MTA releases information about the subways, buses, and commuter trains. To access the real-time data, MTA provides feeds (requires registration). We will focus on the historical data stored about stations.
THe MTA keeps track of the number of people entering and exiting each station via the turnstiles. Readings of how many people entered and exited are measured every 4 hours.
Some stations measure the numbers at midnight, 4am, 8am, noon, 4pm, and 8pm. Others are measured on slightly shifted schedules, but always 4 hours apart. For example, the 68th Street-Hunter College station has each turnstile measured at 1am, 5am, 9am, 1pm, 5pm, and 9pm. These numbers are recorded as cumulative running totals. For example, here is some of the data from the 68th Street-Hunter College station for September 22:
The last two entries on the lines are the entries and exits for that turnstile (in this case, the numbered 00-00-00). At 1am, the entry total was 0026638604 and the exit total was 0015384642. Four hours later, the entry total was 0026638606 and the exit total was 0015384646. So, over that 4-hour period from 1am to 5am, 0026638606-0026638604 = 2 people entered the station via that turnstile. Similarly, 4 people left the station via that turnstile.
Pick a turnstile in your station and make a plot of the number of entries and a plot of the number of exits for the week ending 1 September 2018.
Some useful tips:
Submit a .pdf file that includes the following:
We are going to be using github to make webpages for your projects. There will be only one site for each project, but we want everyone to set up there own page as a warm-up exercise.
Create a github page for your neighborhood.
Submit a .pdf file that contains the URL of your project on github (web address) and a screenshot of your project.
Write a program that takes a weekly turnstile data file and makes a graph of all the entries and a graph of all the exits during the morning commute for your L-train station for that data. The x-axis of your histogram should be the days of the week. The bars in your plot should be the number of people entering the station between 5am and 9am (i.e. subtract the cumulative total at 5am from the cumulative total at 9am, or the closest 4-hour block measured for your station). Similarly, the bars in the second plot should be the exits from your station over the week.
Hints:
Submit a .pdf file that contains the name of your station, as well as the plots for the morning commute entries and exits.
The honors section will have final presentations on 12 December, addressing, the L-train tunnel closure:
In particular,
You may work in teams of up to 3 students to develop your presentation, which has 2 parts:
For this group assignment, include in a .pdf file:
A Voronoi diagram divides a region based on the distance to a set of input points. This simple idea has many applications, one of the most famous was the work of John Snow to study the 1854 cholera outbreak. Our focus will be on mapping access to public resources and transit.
The sample program builds a Voronoi diagram will be for libraries across the city (using the
library data set from NYC Library Locations (download as CSV file).
Our map highlights the regions closest to each library:
To make our map, we
If you are using anaconda (either spyder, idle3, or jupyter), the scipy and matplotlib packages are included. To install geojson, type at a terminal window:
The program, makeVor.py, is a bit rambling, but contains all the steps above (a better design would be to split into separate functions or files for the different tasks). Try running it on the library dataset (assumes that it is in the same folder as the program).
Note that it does very well in dense regions but has odd behavior on the edges of the map since we didn't include in the .json file any point at infinity and didn't clip the maps to the city boundaries.
Modify the program to make to make two Voronoi diagrams:
Submit a .pdf file with a screen capture image of your first HTML map (with all subway stations) and your second HTML map (without L-train stations east of the tunnel). For each map, center the view on your station.
Submit the URL of your group presentation (the two slides for the presentation) as part of a .pdf file. If you have plans to add more to the website, include in the .pdf file any changes you have planned but didn't have a chance to enter yet.
Submit the slides of your group presentation (two slides) as a .pdf file. Your slides should include who is on the team, the neighborhood you chose, and a brief description of your solution to how much additional housing, and what additional services would be needed.
(This is included for completeness, since the forms will be passed out and returned in section on 5 December. After you have commented on others group presentations, we will distribute the forms, so that groups can use these to improve their slides and webpages for the final presentation the following week. )
(Entries, exits, and difference via turnstile #1 at 68th Street-Hunter College station for the week ending 1 September 2018)
C/A,UNIT,SCP,STATION,LINENAME,DIVISION,DATE,TIME,DESC,ENTRIES,EXITS
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/22/2018,01:00:00,REGULAR,0026638604,0015384642
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/22/2018,05:00:00,REGULAR,0026638606,0015384646
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/22/2018,09:00:00,REGULAR,0026638640,0015384847
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/22/2018,13:00:00,REGULAR,0026638946,0015385117
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/22/2018,17:00:00,REGULAR,0026639543,0015385340
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/22/2018,21:00:00,REGULAR,0026639975,0015385496
R246,R177,00-00-00,68ST-HUNTER CO,6,IRT,09/23/2018,01:00:00,REGULAR,0026640099,0015385542
turnsHunter = turnsData[ turnsData["STATION"] == "68ST-HUNTER CO" ]
You can similarly select a single turns(for example, 00-00-01) with turnsHunter and the column name SCP.
myTurns["Entries - Exits"] = myTurns["ENTRIES"] - myTurns["EXITS"]
import seaborn as sns
will then change the default colors and templates to Seaborn.
(Entries and exits (all turnstiles) at 68th Street-Hunter College station for morning commute for the week ending 1 September 2018.)
For example,
entries = turnsHunter9.groupby(by = ['DATE'])['ENTRIES'].sum()-turnsHunter5.groupby(by = ['DATE'])['ENTRIES'].sum()
creates a new series (list) of those who entered each day at 9am and then subtracts off those who entered at 5am (assuming that turnsHunter9 and turnsHunter5 were selected as suggested above).
For example,
en = entries.to_frame().reset_index()
converts the series above into a dataFrame and then resets the index. Once done, the techniques for plotting dataFrames can be used for en.
For 15 months starting in April of 2019, all MTA New York City Transit (NYCT) L train service will be suspended across the East River and within Manhattan to repair damage caused by Superstorm Sandy. The L train will still run within Brooklyn, serving all stops. The temporary closure will directly affect 275,000 of the L Train's 400,000 daily riders, and indirectly affect many more throughout the city. All alternative transit services and traffic management policies are temporary for the duration of the L train closure.
Focusing on different L-train neighborhoods, how will the residents get to work?
pip install geojson