San Diego Burrito Analytics: Data characterization

Scott Cole

2 July 2016

This notebook analyzes the dimensions of burritos

  1. What dimension are people most critical (small mean)? Least critical? Most sensitive? Least sensitive (small variance)?

Default imports


In [1]:
%config InlineBackend.figure_format = 'retina'
%matplotlib inline

import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import pandas as pd
import pandasql

import seaborn as sns
sns.set_style("white")

Load data


In [2]:
import util
df = util.load_burritos()
N = df.shape[0]

Calculate mean and variance of dimension ratings


In [3]:
means = df.mean()
variances = df.var()

In [4]:
print means
print variances


Yelp             3.971831
Google           4.223944
Hunger           3.254930
Cost             6.903592
Length          20.036250
Circum          22.344355
Volume           0.799839
Tortilla         3.358099
Temp             3.573723
Meat             3.479433
Fillings         3.494681
Meat:filling     3.433333
Uniformity       3.283571
Salsa            3.166418
Synergy          3.497143
Wrap             3.864286
overall          3.481221
Unreliable       0.000000
dtype: float64
Yelp            0.243882
Google          0.111196
Hunger          0.729550
Cost            1.211169
Length          5.729760
Circum          1.864168
Volume          0.018044
Tortilla        0.608391
Temp            1.115334
Meat            0.698753
Fillings        0.647989
Meat:filling    1.128381
Uniformity      1.389584
Salsa           0.846270
Synergy         0.816934
Wrap            1.467061
overall         0.583140
Unreliable      0.000000
dtype: float64

people are most critical of salsa, least critical of wrap integrity people are most sensitive to wrap integrity and least sensitive to Fillings (overall???)

Play with ggplot


In [30]:
from ggplot import *
print ggplot(df,aes('Meat','Fillings',color='overall')) +\
    geom_point(size=120,alpha=.2) +\
    xlab('Meat rating') + ylab('Fillings rating') +\
    scale_color_gradient(low = 'red', high = 'blue')


<ggplot: (33004040)>

In [7]:
df


Out[7]:
Location Burrito Date Neighborhood Address URL Yelp Google Hunger Cost ... Pineapple Ham Chile relleno Nopales Lobster Queso Egg Mushroom Bacon Sushi
0 donato's taco shop California 1/18/2016 Miramar 6780 Miramar Rd http://donatostacoshop.net/ 3.5 4.2 3.00 6.49 ... None None None None None None None None None None
1 oscar's mexican food California 1/24/2016 San Marcos 225 S Rancho Santa Fe Rd http://www.yelp.com/biz/oscars-mexican-food-sa... 3.5 3.3 3.50 5.45 ... None None None None None None None None None None
2 oscar's mexican food Carnitas 1/24/2016 San Marcos 225 S Rancho Santa Fe Rd http://www.yelp.com/biz/oscars-mexican-food-sa... 3.5 3.3 1.50 4.85 ... None None None None None None None None None None
3 oscar's mexican food Carne asada 1/24/2016 San Marcos 225 S Rancho Santa Fe Rd http://www.yelp.com/biz/oscars-mexican-food-sa... 3.5 3.3 2.00 5.25 ... None None None None None None None None None None
4 pollos maria California 1/27/2016 Carlsbad 3055 Harding St http://pollosmaria.com/ 4.0 3.8 4.00 6.59 ... None None None None None None None None None None
5 pollos maria combo chicken 1/28/2016 Carlsbad 3055 Harding St http://pollosmaria.com/ 4.0 3.8 4.00 6.99 ... None None None None None None None None None None
6 nico's taco shop California 1/30/2016 Carmel Valley 3860 Valley Centre Dr #404 http://www.yelp.com/biz/nicos-taco-shop-san-diego 3.0 2.9 1.50 7.19 ... None None None None None None None None None None
7 nico's taco shop Carnitas 1/30/2016 Carmel Valley 3860 Valley Centre Dr #404 http://www.yelp.com/biz/nicos-taco-shop-san-diego 3.0 2.9 4.00 6.99 ... None None None None None None None None None None
8 los primos mexican food Monster California 2/1/2016 UTC 7770 Regents Rd http://www.primosmex.com/ 3.0 3.7 3.50 9.25 ... None None None None None None None None None None
9 jv's mexican food Carne Asada 2/6/2016 Morena 1112 Morena Blvd http://jvsmexfood.com/ 4.0 4.1 3.50 6.25 ... None None None None None None None None None None
10 jv's mexican food Surf & Turf 2/6/2016 Morena 1112 Morena Blvd http://jvsmexfood.com/ 4.0 4.1 2.00 9.50 ... None None None None None None None None None None
11 tony's fresh mexican food Chile verde pork 2/11/2016 Miramar 7122 Miramar Rd https://www.yelp.com/biz/tonys-fresh-mexican-f... 3.0 4.1 2.00 6.95 ... None None None None None None None None None None
12 tony's fresh mexican food California 2/11/2016 Miramar 7122 Miramar Rd https://www.yelp.com/biz/tonys-fresh-mexican-f... 3.0 4.1 3.50 6.25 ... None None None None None None None None None None
13 tony's fresh mexican food battered fish 2/11/2016 Miramar 7122 Miramar Rd https://www.yelp.com/biz/tonys-fresh-mexican-f... 3.0 4.1 3.00 6.99 ... None None None None None None None None None None
14 tony's fresh mexican food California 2/11/2016 Miramar 7122 Miramar Rd https://www.yelp.com/biz/tonys-fresh-mexican-f... 3.0 4.1 3.00 6.25 ... None None None None None None None None None None
15 taco stand California 2/12/2016 La Jolla 621 Pearl St http://letstaco.com/ 4.5 4.4 4.00 7.49 ... None None None None None None None None None None
16 taco stand Surf and turf 2/12/2016 La Jolla 621 Pearl St http://letstaco.com/ 4.5 4.4 2.50 8.49 ... None None None None None None None None None None
17 graciela's taco shop Adobada 2/14/2016 Bonita 5047 Central Ave https://www.yelp.com/biz/gracielas-taco-shop-b... 4.0 4.5 3.00 5.99 ... None None None None None None None None None None
18 graciela's taco shop Barbacoa 2/14/2016 Bonita 5047 Central Ave https://www.yelp.com/biz/gracielas-taco-shop-b... 4.0 4.5 2.00 5.99 ... None None None None None None None None None None
19 rigoberto's taco shop California 2/17/2016 La Jolla 7345 La Jolla Blvd https://www.yelp.com/biz/rigobertos-la-jolla-2 2.5 4.0 4.00 6.40 ... None None None None None None None None None None
20 rigoberto's taco shop California 2/17/2016 La Jolla 7345 La Jolla Blvd https://www.yelp.com/biz/rigobertos-la-jolla-2 2.5 4.0 2.50 6.40 ... None None None None None None None None None None
21 lolita's taco shop 2 in 1 2/24/2016 Kearny Mesa 7305 Clairemont Mesa Blvd http://lolitasmexicanfood.com/ 4.0 4.4 3.50 8.75 ... None None None None None None None None None None
22 lolita's taco shop Adobado 2/24/2016 Kearny Mesa 7305 Clairemont Mesa Blvd http://lolitasmexicanfood.com/ 4.0 4.4 2.50 5.50 ... None None None None None None None None None None
23 taco stand California 2/28/2016 La Jolla 621 Pearl St http://letstaco.com/ 4.5 4.4 2.50 7.49 ... None None None None None None None None None None
24 taco stand California 2/28/2016 La Jolla 621 Pearl St http://letstaco.com/ 4.5 4.4 2.50 7.49 ... None None None None None None None None None None
25 lola's 7 up market & deli Shredded beef 2/29/2016 Carlsbad 3292 Roosevelt St https://www.yelp.com/biz/lolas-7-up-market-and... 4.5 4.9 3.50 6.00 ... None None None None None None None None None None
26 lola's 7 up market & deli Carne asada 2/29/2016 Carlsbad 3292 Roosevelt St https://www.yelp.com/biz/lolas-7-up-market-and... 4.5 4.9 3.50 7.00 ... None None None None None None None None None None
27 colima's mexican food Hawaiian 3/3/2016 North park 2302 University Ave https://www.yelp.com/biz/colimas-mexican-food-... 4.0 4.2 3.50 6.29 ... x x None None None None None None None None
28 colima's mexican food Bandido 3/3/2016 North park 2302 University Ave https://www.yelp.com/biz/colimas-mexican-food-... 4.0 4.2 4.50 6.49 ... None None x None None None None None None None
29 colima's mexican food Bandido 3/3/2016 North park 2302 University Ave https://www.yelp.com/biz/colimas-mexican-food-... 4.0 4.2 4.50 6.49 ... None None x None None None None None None None
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
112 los primos mexican food California 6/3/2016 UTC None None 3.0 3.7 3.00 7.00 ... None None None None None None None None None None
113 los primos mexican food California breakfast 6/3/2016 UTC None None 3.0 3.7 2.50 6.25 ... None None None None None None x None None None
114 los primos mexican food Baja monster 6/3/2016 UTC None None 3.0 3.7 4.00 6.00 ... None None None None None None None None None None
115 los primos mexican food Baja monster 6/3/2016 UTC None None 3.0 3.7 3.00 6.00 ... None None None None None None None None None None
116 los primos mexican food Carnitas 6/3/2016 UTC None None 3.0 3.7 4.50 6.35 ... None None None None None None None None None None
117 los tacos Local 6/5/2016 Oceanside None None 4.0 4.2 3.50 7.90 ... X None None None None None None None None None
118 los tacos Fusion 6/5/2016 Oceanside None None 4.0 4.2 3.50 8.50 ... None None None None None None None None None None
119 taco stand Al pastor 6/6/2016 La Jolla None None 4.5 4.4 3.50 6.99 ... x None None None None None None None None None
120 taco stand Al pastor 6/6/2016 La Jolla None None 4.5 4.4 5.00 6.99 ... x None None None None None None None None None
121 albertacos California 6/8/2016 San Marcos None None 3.5 3.9 3.50 5.70 ... None None None None None None None None None None
122 albertacos Carne asada 6/8/2016 San Marcos None None 3.5 3.9 4.00 5.25 ... None None None None None None None None None None
123 el rey moro California Surf 6/9/2016 Clairemont None None 4.0 3.8 2.80 9.19 ... None None None None None None None None None None
124 tacos por favor Carne asada 6/11/2016 Santa Monica None None 4.0 4.1 3.00 7.85 ... None None None None None None None None None None
125 tacos por favor Al pastor 6/11/2016 Santa Monica None None 4.0 4.1 4.00 6.85 ... None None None None None None None None None None
126 tacos por favor Carne asada 6/11/2016 Santa Monica None None 4.0 4.1 4.00 6.85 ... None None None None None None None None None None
127 el dorado mexican food California 6/16/2016 Temecula None None 4.5 4.0 4.00 6.94 ... None None None None None None None None None None
128 el dorado mexican food Super 6/16/2016 Temecula None None 4.5 4.0 3.75 6.94 ... None None None None None None None None None None
129 lolita's taco shop California 6/23/2016 Kearny Mesa None None 4.0 4.4 2.20 7.00 ... None None None None None None None None None None
130 lolita's taco shop California 6/23/2016 Kearny Mesa None None 4.0 4.4 3.50 7.00 ... None None None None None None None None None None
131 lolita's taco shop California 6/23/2016 Kearny Mesa None None 4.0 4.4 3.00 7.00 ... None None None None None None None None None None
132 lolita's taco shop Mixed 6/23/2016 Kearny Mesa None None 4.0 4.4 4.00 8.25 ... None None None None None None None None None None
133 california burritos California Everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 3.00 6.25 ... None None None None None None None None None None
134 california burritos California Everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 4.50 6.25 ... None None None None None None None None None None
135 california burritos California Everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 4.00 6.25 ... None None None None None None None None None None
136 california burritos California Everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 3.00 6.25 ... None None None None None None None None None None
137 california burritos California Everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 4.00 6.25 ... None None None None None None None None None None
138 california burritos Carnitas 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 4.50 5.50 ... None None None None None None None None None None
139 california burritos Carne asada everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 3.00 6.25 ... None None None None None None None None None None
140 california burritos Carne asada everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 4.50 6.25 ... None None None None None None None None None None
141 california burritos Carne asada everything 6/24/2016 Linda Vista 7754 Starling Dr https://www.yelp.com/biz/california-burritos-s... 4.5 4.4 5.00 6.25 ... None None None None None None None None None None

142 rows × 62 columns


In [ ]: