Lecture 29 – Perception, Case Study

Data 6, Summer 2021

Perception

Case Study – Skyscrapers

Which cities have the most skyscrapers?

Do any of the above cities stick out to you?

What is the distribution of skyscraper heights?

Let's zoom in a little more.

What's the distribution of short vs. tall skyscrapers in each city?

Let's say a skyscraper is "short" if its height is less than or equal to 150 meters; otherwise, it's "tall".

We can use pivot to draw a bar chart of the number of short and tall skyscrapers per city.

Quick Check 1

Fill in the blanks to create the table short_and_tall, which has two columns, 'short' and 'tall', and one row for each city with at least 5 short and 5 tall skyscrapers. The first five rows of short_and_tall are shown below.

city short tall
New York City 341 217
Chicago 268 108
Miami 58 49
Houston 34 27
San Francisco 43 22
short_and_tall = sky.pivot(__(a)__, __(b)__) \
                    .where(__(c)__, are.above_or_equal_to(5)) \
                    .where('tall', are.above_or_equal_to(5)) \
                    .sort('tall', descending = True)

It seems like most cities have roughly twice as many "short" skyscrapers as they do "tall" skyscrapers.

What if we want to look at the distribution of the number of floors per skyscraper, separated by height category?

Since there is overlap between the two histograms, we have that there are some short skyscrapers (below 150m) with more floors than some tall skyscrapers!

What's the relationship between height and number of floors?

How many skyscrapers were built per year?

This is obviously an error in our data.

What if we want to look at the number of skyscrapers per year built in different cities?

Where on a map are most skyscrapers located?

Let's look at a map of tall skyscrapers in New York City.

It seems like most skyscrapers in NYC are either in the financial district or in Midtown. The circles for One World Trade Center and the Empire State Building are bright.

Lastly, what if we want to look at where short and tall skyscrapers are throughout the country?

There are two solutions here.

  1. Create a function that takes in 'short' or 'tall' and returns the desired color. (We did this in Lecture 28.)
  2. Create a table with two columns, one with 'short' and 'tall' and the other with the desired colors, and join this table with sky.

We will use the second approach here.

While there seem to be short skyscrapers (orange) throughout the country, tall skyscrapers generally seem to be concentrated in larger cities.