Introduction

The visualizations below are created from data provided by “Restaurant Business” Magazine and downloaded from https://www.kaggle.com/michau96/restaurant-business-rankings-2020?select=Independence100.csv. The data consists of the Top 100 Independent Restaurants of 2020 throughout the United States. Restaurants with no more than five locations are considered as “independent” in the analysis. The data is comprised of sales figures, number of meals served, average check amount, restaurant name, the rank of the restaurant, and the city and state the restaurant is located in. This data provides insight into consumer spending habits and societal trends.

Findings

Top 10 Restaurants by Meals Served

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import warnings
import wget
import datetime

warnings.filterwarnings("ignore")

filename = '/Users/danwigley/Desktop/Independence100.csv'
df = pd.read_csv(filename)
df
meals_served_df = df.groupby(['Restaurant', 'Meals Served'])['Meals Served'].count().reset_index(name='count')
meals_served_df = meals_served_df.sort_values('Meals Served', ascending=False)
meals_served_df.reset_index(inplace=True, drop=True)
plt.figure(figsize=(26,26))
plt.bar(meals_served_df.loc[:9, 'Restaurant'], meals_served_df.loc[:9, 'Meals Served'], label = 'Count')
plt.legend(loc = 'upper right', fontsize=14)
plt.xticks(rotation=45, fontsize=15)
plt.yticks(fontsize=14)
plt.show()

The bar chart displays the Top 10 Restaurants and the number of meals served. This visualization provides insight into which restaurants are busiest and serve the most amount of meals to customers. As a customer, this analysis can display potential trends of the type of foods other customers are eating most as well as the restaurants that are busy and will probably need reservations.

Top States by Sales

state1 = df.groupby(['State'])['Sales'].sum().reset_index()
state1 = state1.loc[:9]
number_outside_colors = len(state1['State'].unique())
outside_color_ref_number = np.arange(number_outside_colors)*2
print(outside_color_ref_number)
fig = plt.figure(figsize=(22,22))
ax = fig.add_subplot(1,1,1)

colormap = plt.get_cmap("tab20")
outer_colors = colormap(outside_color_ref_number)

total_sales = state1.Sales.sum()
# print(total_titles)

state1.groupby(['State'])['Sales'].sum().plot(
        kind='pie', radius=1, colors= outer_colors, pctdistance=0.85, labeldistance=1.1,
        wedgeprops = dict(edgecolor='w'), textprops={'fontsize':18}, 
        autopct = lambda p: '{:.2f}%\n(${:.1f}M)'.format(p,(p/100)*total_sales/1e+6),
        startangle=90)

hole = plt.Circle((0,0),0.2, fc='white')
fig1 = plt.gcf()
fig1.gca().add_artist(hole)

ax.yaxis.set_visible(False)
plt.title('Total Sales by Top 10 States', fontsize=18)

ax.text(0,0, 'Total Sales\n' + '$' + str(total_sales), ha = 'center', va= 'center', fontsize=20)

ax.axis('equal')
plt.tight_layout()
plt.show()

The pie chart displays the Top 10 States with the highest total sales. As a person that loves to try new foods and enjoys a nice restaurant, this visualization can show consumers which States have the most popular restaurants and potentially the best food, however consumers must consider the effect that population size has on the data. A person that enjoys traveling the United States may find this visual as helpful in deciding which States to visit because it helps display potential night-life trends as well as new experiences.

Restaurants with Highest Average Check

average_check_df = df.groupby(['Restaurant','State'])['Average Check'].sum().reset_index()
average_check_df = average_check_df.sort_values('Average Check', ascending=False)
average_check_df.reset_index(inplace=True, drop=True)
plt.figure(figsize=(18,10))
plt.barh(average_check_df.loc[:9, 'Restaurant'], average_check_df.loc[:9, 'Average Check'], label = 'Count')
plt.legend(loc = 'upper right', fontsize=14)
plt.xticks(rotation=45, fontsize=14)
plt.yticks(fontsize=14)
plt.show()

The horizontal bar chart displays the Top 10 Restaurants with the highest average check. This chart is beneficial for consumers because it visualizes how expensive the restaurant is. Understanding the pricing of a restaurant before visiting is a major factor for many consumer and the visualization can help with that. The chart is interesting because it points out the fact that steakhouses are typically the more expensive restaurants.

Top 10 Restaurants by Sales

state_meals_df = df.groupby(['Restaurant'])['Sales'].sum().reset_index()
state_meals_df = state_meals_df.sort_values('Sales', ascending=False)
state_meals_df.reset_index(inplace=True, drop=True)
plt.figure(figsize=(26,26))
plt.bar(state_meals_df.loc[:9, 'Restaurant'], state_meals_df.loc[:9, 'Sales'], label = 'Count')
plt.legend(loc = 'upper right', fontsize=14)
plt.xticks(rotation=45, fontsize=15)
plt.yticks(fontsize=14)
plt.title('Top 10 Restaurants by Sales', fontsize=20)
plt.show()

The bar chart above displays the Top 10 Restaurants by Sales. Sales transactions are a reliable way to see trends in the market. As a consumer, knowing the restaurants that are the most popular during the year is important, especially in a big city.

Rank Vs. Average Check

rank_df = df.groupby(['Restaurant','Rank'])['Average Check'].sum().reset_index()
rank_df = rank_df.sort_values('Average Check', ascending = False)
rank_df.reset_index(inplace=True, drop=True)
rank_df = rank_df.loc[:9]
fig = plt.figure(figsize=(10,14))
ax1 = fig.add_subplot(1,1,1)
ax2 = ax1.twinx()
bar_width = 0.4

x_pos = np.arange(10)
rank_bars = ax1.bar(x_pos - (0.5*bar_width), rank_df.Rank, bar_width, color='gray', edgecolor='black', label='Rank')
check_bars = ax2.bar(x_pos + (0.5*bar_width), rank_df['Average Check'], bar_width, color='blue', edgecolor='black', label='Rank')

labels = ['Del Posto',
'Prime Steakhouse',
'SW Steakhouse',
'Prime 112',
'Prime & Provisions',
'Bazaar Meat by Jose Andres',
'Swift & Sons',
'Quality Meats',
'BOA Steakhouse', 
'Gibsons Italia']

ax1.set_xlabel('Restaurant', fontsize=18)
ax1.set_ylabel('Magazine Rank', fontsize=18, labelpad=20)
ax2.set_ylabel('Average Check', fontsize=18, rotation= 270, labelpad=20)
ax1.set_xticklabels(labels, rotation=45)
plt.xticks(np.arange(10))
plt.xticks(rotation=45, fontsize=12)
plt.title('Restaurant Rank Compared to Average Check for Top 10 Expensive Restaurants', fontsize=17)
# rank_color, rank_label = ax1.get_legend_handles_labels()
# check_color, check_label = ax2.get_legend_handles_labels()
# legend = ax1.legend(rank_color + check_color, rank_label + check_label, loc = 'upper center', frameon = True, ncol=1,
#                    shadow=True, borderpad=1, fontsize=14)
plt.show()

The dual-axis bar chart displays the Restaurant rank compared to the average check for the top 10 most expensive restaurants. The magazine rank is on the y-axis on the left and the average check amount is on the y-axis on the right. The chart displays to consumers the respective average check and rank for the restaurant. This is good to know because if a restaurant is ranked low but is very expensive then maybe it is not worth it. This visualization shows if an expensive restaurant is worth it for a consumer since the rank is incorporated.

Conclusion

The visualizations provided give lots of insight into independent restaurants. Consumers will find the visualizations helpful since it will show the expensive restaurants, their ranks, sales trends, and locations. Consumers interested in traveling will greatly benefit from this analysis since they can draw inferences from the data before making travel plan decisions.