Storytelling with Data Project

Data Visualization Using Python’s Matplotlib and Seaborn Packages

Danny Garcia
Towards Data Science

--

2 x 2 Image of Graphs From Project
Sample charts from my project.

Data visualizations generally serve one of two goals: to present or to explore data. Here I rely on the former and use a combination of python’s Matplotlib and Seaborn package to accomplish that.

This article will give a brief overview of my findings presented in a project for Practicum’s Data Analyst program. Stay tuned for a part 2, where I’ll show you how to create similar graphs that were used for this project.

The Assignment

You’ve decided to open a small robot-run cafe in Los Angeles. The project is promising but expensive, so you and your partners decide to try to attract investors. They’re interested in the current market conditions — will you be able to maintain your success when the novelty of robot waiters wears off?

Draw an overall conclusion and provide recommendations on restaurant type and number of seats. Make a presentation of your research to share with investors — the target audience.

Data Description

Open-source data on restaurants in Los Angeles. Click here here to download the dataset.

  • object_name — establishment name
  • chain — chain establishment (TRUE/FALSE)
  • object_type — establishment type
  • address — address
  • number — number of seat

What kinds of establishments are popular in LA?

Roughly 3/4 of establishments in LA are proper restaurants, with fast food coming in second (~10%).

When looking at the count figures, we see that 7,255 of establishments in LA are of a restaurant type. In comparison, Cafes (the proposed establishment) come at a low 435 count or 5% of total establishments. To build on this, it will be nice to look through the proportion of non-chain to chain establishments.

What are the proportions of Chain vs. Non-Chain Establishments?

There’s a large share (~2/3) of small players (non-chain establishments) in the current LA market.

Which types of establishments are typically chains?

Cafes have a higher chance of being a chain establishment. In addition, around 1/3 (31.6%) of restaurants belong to chains; this is likely the reason why non-chains were well represented in the pie chart earlier.

This figure parallels the findings of an in-depth study (5,000 surveys and more than 100 interviews) conducted by Allegra World Coffee, which indicated that nearly 4 out of 5 (78%) coffee shops are chain establishments — and that proportion is only growing.

These figures suggest that in the long term, it would be more prudent to open a restaurant than a cafe.

What characterizes chains: many establishments with a small number of seats or a few establishments with a lot of seats?

This visualization shows us that, with a median of 25 seats per establishment, chains lean toward having many establishments with a low number of seats (1–50 seats) — characterizes about 82% of establishments.

Which chain establishment type, relative to their total, has the highest concentration of establishments with “many seats?”

So for the chain establishments, the few seat proportion for each establishment type falls near 80%, if not more, above that percentage.

Notice that the graph shows that the “many seat” proportion for establishment types, of which restaurants have by far the greatest share, where likely the reason of bringing the aggregate “few seats” proportion down to 80%.

Moreover, the few seats percentage for restaurants establishment indicates that there are many small chain restaurants in LA. Let’s continue exploring

Which chain restaurant has the greatest number of seats?

When we consider the aggregate average, notice how the 4 establishment types’ average number of seats fall more than 10 seats below it.

The majority of the “many seats“ values on the seat distribution (see figure above) can be attributed to restaurant and bar establishments. Considering the previous graph, the average number of seats for restaurant chains seem like a reasonable number of seats that the company can start with.

What streets have the highest establishment concentrations?

These streets contain more than 110 and up to ~325 establishments. Further analysis showed that 68% of streets contain 1 restaurant, whilst 32% contain more than 1.

These streets may be of interest to the company if they want to enter a competitive but thriving market.

Recommendations

When thinking about establishing in LA, given (1) chosen establishment (small Cafe), (2) the novelty of the service provided (robot waiters), (3) the current market conditions, (4) cost of the project, and (5) long-term goal to maintain a successful establishment, the following recommendation is given:

  • The company should consider opening a restaurant rather than a cafe, as big players occupy less space in the restaurant market. Small cafes are being out-competed by cafe chains.
  • The company should consider starting off as a standalone establishment with 48 seats (the average for restaurant chains) and, depending on its strategy, select a street with either many restaurants or one restaurant. It can then aggressively grow and establish a chain based on the novelty of its robot-waiter approach.

Closing Thoughts

As a relative newbie in the world of programming, creating the charts outlined above was out of scope for me a few months ago. Sure, I could have gone with libraries such as Plotly, but I really wanted to get my head around the way graphs are structure. Matplotlib and Seaborn (which is built on top of Matplotlib), helped me accomplish that.

Personally, I’d say this was a challenging project that taught me how to think about the audience, context, and the story that I was trying to tell as I was creating the graphs above. It was also through this project that I fell in love with data visualization, and am excited to continue practicing and learning more about this vast and creative field.

Anyways, I recognize that I didn’t include any code as well as my analysis process for this project; I chose to leave that out since I didn’t want to make this article longer than what it already is. With that said, stay tuned for a part 2 where I’ll show you how to make some of the charts outlined above.

Click here to learn more about Practicum’s Data Analyst program, a practice-intensive course that teaches you the basics of data science and its application in business analytics.

Also, if you’d like, let’s connect on LinkedIn.

--

--