Analyzing Thanksgiving Dinner

This notebook analyzes Thanksgiving dinner in the US. The dataset contains 1058 responses to an online survey about what Americans eat for Thanksgiving dinner, along with some demographic questions, like gender, income, and location. Using this dataset we can discover regional and income-based patterns in what Americans eat for Thanksgiving dinner.


In [75]:
import pandas as pd
data = pd.read_csv("thanksgiving.csv", encoding = 'Latin-1')
data.head()


Out[75]:
RespondentID Do you celebrate Thanksgiving? What is typically the main dish at your Thanksgiving dinner? What is typically the main dish at your Thanksgiving dinner? - Other (please specify) How is the main dish typically cooked? How is the main dish typically cooked? - Other (please specify) What kind of stuffing/dressing do you typically have? What kind of stuffing/dressing do you typically have? - Other (please specify) What type of cranberry saucedo you typically have? What type of cranberry saucedo you typically have? - Other (please specify) ... Have you ever tried to meet up with hometown friends on Thanksgiving night? Have you ever attended a "Friendsgiving?" Will you shop any Black Friday sales on Thanksgiving Day? Do you work in retail? Will you employer make you work on Black Friday? How would you describe where you live? Age What is your gender? How much total combined money did all members of your HOUSEHOLD earn last year? US Region
0 4337954960 Yes Turkey NaN Baked NaN Bread-based NaN None NaN ... Yes No No No NaN Suburban 18 - 29 Male $75,000 to $99,999 Middle Atlantic
1 4337951949 Yes Turkey NaN Baked NaN Bread-based NaN Other (please specify) Homemade cranberry gelatin ring ... No No Yes No NaN Rural 18 - 29 Female $50,000 to $74,999 East South Central
2 4337935621 Yes Turkey NaN Roasted NaN Rice-based NaN Homemade NaN ... Yes Yes Yes No NaN Suburban 18 - 29 Male $0 to $9,999 Mountain
3 4337933040 Yes Turkey NaN Baked NaN Bread-based NaN Homemade NaN ... Yes No No No NaN Urban 30 - 44 Male $200,000 and up Pacific
4 4337931983 Yes Tofurkey NaN Baked NaN Bread-based NaN Canned NaN ... Yes No No No NaN Urban 30 - 44 Male $100,000 to $124,999 Pacific

5 rows × 65 columns


In [76]:
data.columns


Out[76]:
Index(['RespondentID', 'Do you celebrate Thanksgiving?',
       'What is typically the main dish at your Thanksgiving dinner?',
       'What is typically the main dish at your Thanksgiving dinner? - Other (please specify)',
       'How is the main dish typically cooked?',
       'How is the main dish typically cooked? - Other (please specify)',
       'What kind of stuffing/dressing do you typically have?',
       'What kind of stuffing/dressing do you typically have? - Other (please specify)',
       'What type of cranberry saucedo you typically have?',
       'What type of cranberry saucedo you typically have? - Other (please specify)',
       'Do you typically have gravy?',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Brussel sprouts',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Carrots',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Cauliflower',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Corn',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Cornbread',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Fruit salad',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Green beans/green bean casserole',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Macaroni and cheese',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Mashed potatoes',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Rolls/biscuits',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Squash',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Vegetable salad',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Yams/sweet potato casserole',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Other (please specify)',
       'Which of these side dishes aretypically served at your Thanksgiving dinner? Please select all that apply. - Other (please specify).1',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Apple',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Buttermilk',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Cherry',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Chocolate',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Coconut cream',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Key lime',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Peach',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Pecan',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Pumpkin',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Sweet Potato',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - None',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Other (please specify)',
       'Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Other (please specify).1',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Apple cobbler',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Blondies',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Brownies',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Carrot cake',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Cheesecake',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Cookies',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Fudge',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Ice cream',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Peach cobbler',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - None',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Other (please specify)',
       'Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Other (please specify).1',
       'Do you typically pray before or after the Thanksgiving meal?',
       'How far will you travel for Thanksgiving?',
       'Will you watch any of the following programs on Thanksgiving? Please select all that apply. - Macy's Parade',
       'What's the age cutoff at your "kids' table" at Thanksgiving?',
       'Have you ever tried to meet up with hometown friends on Thanksgiving night?',
       'Have you ever attended a "Friendsgiving?"',
       'Will you shop any Black Friday sales on Thanksgiving Day?',
       'Do you work in retail?',
       'Will you employer make you work on Black Friday?',
       'How would you describe where you live?', 'Age', 'What is your gender?',
       'How much total combined money did all members of your HOUSEHOLD earn last year?',
       'US Region'],
      dtype='object')

In [77]:
data['Do you celebrate Thanksgiving?'].value_counts()


Out[77]:
Yes    980
No      78
Name: Do you celebrate Thanksgiving?, dtype: int64

We need to filter out the people who didn't celebrate Thanksgiving.


In [78]:
filter_yes = data['Do you celebrate Thanksgiving?'] == "Yes"
data = data.loc[filter_yes]
data


Out[78]:
RespondentID Do you celebrate Thanksgiving? What is typically the main dish at your Thanksgiving dinner? What is typically the main dish at your Thanksgiving dinner? - Other (please specify) How is the main dish typically cooked? How is the main dish typically cooked? - Other (please specify) What kind of stuffing/dressing do you typically have? What kind of stuffing/dressing do you typically have? - Other (please specify) What type of cranberry saucedo you typically have? What type of cranberry saucedo you typically have? - Other (please specify) ... Have you ever tried to meet up with hometown friends on Thanksgiving night? Have you ever attended a "Friendsgiving?" Will you shop any Black Friday sales on Thanksgiving Day? Do you work in retail? Will you employer make you work on Black Friday? How would you describe where you live? Age What is your gender? How much total combined money did all members of your HOUSEHOLD earn last year? US Region
0 4337954960 Yes Turkey NaN Baked NaN Bread-based NaN None NaN ... Yes No No No NaN Suburban 18 - 29 Male $75,000 to $99,999 Middle Atlantic
1 4337951949 Yes Turkey NaN Baked NaN Bread-based NaN Other (please specify) Homemade cranberry gelatin ring ... No No Yes No NaN Rural 18 - 29 Female $50,000 to $74,999 East South Central
2 4337935621 Yes Turkey NaN Roasted NaN Rice-based NaN Homemade NaN ... Yes Yes Yes No NaN Suburban 18 - 29 Male $0 to $9,999 Mountain
3 4337933040 Yes Turkey NaN Baked NaN Bread-based NaN Homemade NaN ... Yes No No No NaN Urban 30 - 44 Male $200,000 and up Pacific
4 4337931983 Yes Tofurkey NaN Baked NaN Bread-based NaN Canned NaN ... Yes No No No NaN Urban 30 - 44 Male $100,000 to $124,999 Pacific
5 4337929779 Yes Turkey NaN Roasted NaN Rice-based NaN Homemade NaN ... Yes Yes Yes No NaN Urban 18 - 29 Male $0 to $9,999 Pacific
6 4337924420 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No Yes Yes No Rural 18 - 29 Male $25,000 to $49,999 East North Central
7 4337916002 Yes Turkey NaN Baked NaN Rice-based NaN Homemade NaN ... Yes Yes Yes Yes Yes Rural 18 - 29 Male Prefer not to answer Mountain
8 4337914977 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... Yes No No No NaN Urban 30 - 44 Male $75,000 to $99,999 Middle Atlantic
9 4337899817 Yes Other (please specify) Turkey and Ham Baked NaN Bread-based NaN Other (please specify) Both Canned and Homemade ... No No No Yes Yes Suburban 30 - 44 Male $25,000 to $49,999 East South Central
11 4337893416 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 30 - 44 Male $25,000 to $49,999 Middle Atlantic
12 4337888291 Yes Ham/Pork NaN Roasted NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 18 - 29 Male $0 to $9,999 East North Central
13 4337878450 Yes Turkey NaN Baked NaN Rice-based NaN Homemade NaN ... Yes Yes Yes No NaN Urban 18 - 29 Male $0 to $9,999 Middle Atlantic
14 4337878351 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... No No No No NaN Rural 60+ Male $50,000 to $74,999 West North Central
15 4337857295 Yes Turkey NaN Roasted NaN Rice-based NaN Canned NaN ... Yes Yes No No NaN Suburban 30 - 44 Male $200,000 and up Pacific
16 4337856362 Yes Turducken NaN Roasted NaN Bread-based NaN Homemade NaN ... Yes Yes Yes Yes Doesn't apply Suburban 30 - 44 Male $200,000 and up Pacific
17 4337854106 Yes Turkey NaN Baked NaN Bread-based NaN None NaN ... No Yes Yes No NaN Urban 18 - 29 Male $75,000 to $99,999 East North Central
18 4337844879 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 30 - 44 Male $25,000 to $49,999 Mountain
19 4337823612 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... Yes No No No NaN Rural 30 - 44 Male $75,000 to $99,999 East North Central
20 4337820281 Yes Turkey NaN Baked NaN Bread-based NaN Homemade NaN ... Yes Yes No No NaN Urban 30 - 44 Male $75,000 to $99,999 Pacific
21 4337813502 Yes Turkey NaN Fried NaN None NaN Homemade NaN ... Yes Yes Yes Yes Yes Urban 18 - 29 Male $0 to $9,999 Pacific
23 4337793158 Yes Turkey NaN Baked NaN Rice-based NaN Homemade NaN ... No No No No NaN Urban 18 - 29 Male $0 to $9,999 Pacific
24 4337792130 Yes Turkey NaN Baked NaN Bread-based NaN None NaN ... Yes Yes Yes No NaN Suburban 30 - 44 Female $50,000 to $74,999 West South Central
25 4337790002 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... No No No No NaN Rural 18 - 29 Male $200,000 and up Middle Atlantic
26 4337783794 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... No No No No NaN Urban 30 - 44 Male $50,000 to $74,999 South Atlantic
27 4337779071 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... Yes Yes Yes Yes Yes Suburban 18 - 29 Male $100,000 to $124,999 East North Central
28 4337778119 Yes Other (please specify) Varies Baked NaN Bread-based NaN Homemade NaN ... No Yes No No NaN Urban 30 - 44 Female Prefer not to answer Pacific
29 4337774090 Yes Turkey NaN Baked NaN Bread-based NaN None NaN ... No No No No NaN Urban 30 - 44 Male $75,000 to $99,999 Pacific
30 4337772882 Yes Other (please specify) some kind of lentil or vegetable stew Other (please specify) stovetop None NaN Homemade NaN ... No No No No NaN Urban 30 - 44 Female $25,000 to $49,999 Pacific
32 4337772193 Yes Turkey NaN Baked NaN None NaN Homemade NaN ... No No Yes No NaN Urban 18 - 29 Male Prefer not to answer Pacific
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
1024 4335957365 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 45 - 59 Male $100,000 to $124,999 West South Central
1025 4335957179 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... No Yes No No NaN Urban 60+ Female $75,000 to $99,999 Pacific
1026 4335957096 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 45 - 59 Male $175,000 to $199,999 East North Central
1027 4335957072 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... Yes No No No NaN Suburban 60+ Male $75,000 to $99,999 Middle Atlantic
1029 4335955478 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... Yes No No No NaN Suburban 60+ Male $50,000 to $74,999 South Atlantic
1030 4335955206 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... No No No No NaN Suburban 45 - 59 Male $10,000 to $24,999 Pacific
1031 4335955152 Yes Ham/Pork NaN Baked NaN Rice-based NaN None NaN ... Yes No Yes No NaN Suburban 45 - 59 Female $75,000 to $99,999 West North Central
1033 4335954681 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No Yes No NaN Urban 30 - 44 Male $75,000 to $99,999 East South Central
1034 4335954394 Yes Turkey NaN Other (please specify) Rotisserie Bread-based NaN Homemade NaN ... No No No No NaN Suburban 30 - 44 Female Prefer not to answer Pacific
1035 4335954376 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... Yes Yes No No NaN Suburban 30 - 44 Male $25,000 to $49,999 East North Central
1037 4335954207 Yes Other (please specify) salmon Baked NaN None NaN None NaN ... No No No No NaN Suburban 30 - 44 Female $10,000 to $24,999 Pacific
1038 4335954131 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 60+ Male $100,000 to $124,999 Pacific
1039 4335953888 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... Yes Yes No No NaN Suburban 18 - 29 Female $75,000 to $99,999 East South Central
1040 4335952833 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No Yes No Yes Yes Suburban 30 - 44 Female $50,000 to $74,999 New England
1041 4335951505 Yes Turkey NaN Roasted NaN Other (please specify) Cornbread Canned NaN ... No No Yes No NaN Rural 45 - 59 Female $25,000 to $49,999 West South Central
1042 4335951437 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No No No NaN Rural 45 - 59 Female $125,000 to $149,999 Mountain
1043 4335951082 Yes Turkey NaN Roasted NaN Bread-based NaN None NaN ... No No No No NaN Suburban 45 - 59 Male $75,000 to $99,999 East North Central
1044 4335950917 Yes Turkey NaN Roasted NaN None NaN Canned NaN ... Yes No Yes No NaN Suburban 60+ Male $25,000 to $49,999 West North Central
1045 4335950654 Yes Turkey NaN I don't know NaN Bread-based NaN Canned NaN ... Yes Yes Yes No NaN Suburban 30 - 44 Male $75,000 to $99,999 Pacific
1046 4335949486 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... Yes Yes Yes Yes No Urban 18 - 29 Male $10,000 to $24,999 South Atlantic
1047 4335949169 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... No Yes No No NaN Urban 30 - 44 Female $25,000 to $49,999 Pacific
1048 4335949112 Yes Turkey NaN Baked NaN Bread-based NaN Homemade NaN ... No No No No NaN Suburban 60+ Male $75,000 to $99,999 West North Central
1049 4335947496 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
1050 4335945415 Yes Turkey NaN Roasted NaN Bread-based NaN None NaN ... No No No No NaN Rural 60+ Male $125,000 to $149,999 South Atlantic
1051 4335944854 Yes Turkey NaN Roasted NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 60+ Male $125,000 to $149,999 Pacific
1053 4335944082 Yes Turkey NaN Roasted NaN Bread-based NaN Homemade NaN ... Yes Yes No No NaN Rural 30 - 44 Female $100,000 to $124,999 Mountain
1054 4335943173 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... No No No No NaN Suburban 60+ Female $50,000 to $74,999 Pacific
1055 4335943060 Yes Other (please specify) Duck Baked NaN Rice-based NaN None NaN ... Yes Yes Yes No NaN Urban 60+ Male $100,000 to $124,999 Pacific
1056 4335934708 Yes Turkey NaN Baked NaN None NaN Homemade NaN ... Yes No Yes Yes Yes NaN NaN NaN NaN NaN
1057 4335894916 Yes Turkey NaN Baked NaN Bread-based NaN Canned NaN ... Yes Yes Yes No NaN NaN NaN NaN NaN NaN

980 rows × 65 columns

What main dishes do people eat at Thanksgiving?


In [79]:
data['What is typically the main dish at your Thanksgiving dinner?'].value_counts()


Out[79]:
Turkey                    859
Other (please specify)     35
Ham/Pork                   29
Tofurkey                   20
Chicken                    12
Roast beef                 11
I don't know                5
Turducken                   3
Name: What is typically the main dish at your Thanksgiving dinner?, dtype: int64

In [80]:
filter_tofurkey = data['What is typically the main dish at your Thanksgiving dinner?'] == 'Tofurkey'
tofurkey = data.loc[filter_tofurkey]
tofurkey['Do you typically have gravy?'].value_counts()


Out[80]:
Yes    12
No      8
Name: Do you typically have gravy?, dtype: int64

How many people ate apple, pumpkin or pecan pie at Thanksgiving?


In [81]:
apple_isnull = data['Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Apple'].isnull()
pumpkin_isnull = data['Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Pumpkin'].isnull()
pecan_isnull = data['Which type of pie is typically served at your Thanksgiving dinner? Please select all that apply. - Pecan'].isnull()
ate_pies = apple_isnull & pumpkin_isnull & pecan_isnull
ate_pies.value_counts()


Out[81]:
False    876
True     104
dtype: int64

876 people ate pies (is null was false), and 182 people didn't.


In [82]:
proportion = 876/(876+182)
proportion


Out[82]:
0.8279773156899811

82% of people ate pies.

What is the mean age of people celebrating Thanksgiving?


In [83]:
import numpy as np

def convert_age(value):
    if pd.isnull(value):
        return None
    str2 = value.split(' ')[0]
    str2 = str2.replace('+',' ')
    return int(str2)
    
data['int_age'] = data['Age'].apply(convert_age)    
np.mean(data['int_age'])


Out[83]:
40.08975712777191

We used the bottom of each age interval, so our mean would be an underestimate of the mean age.

What is the average income of people celebrating Thanksgiving?


In [84]:
import numpy as np

def convert_income(value):
    if pd.isnull(value):
        return None
    if value == 'Prefer not to answer':
        return None
    str2 = value.split(' ')[0]
    str2 = str2.replace('$', '')
    str2 = str2.replace(',', '')
    return int(str2)

data['int_income'] = data['How much total combined money did all members of your HOUSEHOLD earn last year?'].apply(convert_income)
data_income = data['int_income'].dropna()
data_income.describe()


Out[84]:
count       829.000000
mean      75965.018094
std       59068.636748
min           0.000000
25%       25000.000000
50%       75000.000000
75%      100000.000000
max      200000.000000
Name: int_income, dtype: float64

Using the bottom of each range of income would likely underestimate mean. Also, we don't know where in the range the mean person would fall.

Let's determine how distance traveled for Thanksgiving dinner relates to income level. Our hypothesis is that people earning less money could be younger, and would travel to their parent's houses for Thanksgiving. People earning more are more likely to have Thanksgiving at their house as a result.


In [85]:
less_than_50k = data['int_income'] < 50000
filter_less_50k = data[less_than_50k]
filter_less_50k['How far will you travel for Thanksgiving?'].value_counts()


Out[85]:
Thanksgiving is happening at my home--I won't travel at all                         106
Thanksgiving is local--it will take place in the town I live in                      92
Thanksgiving is out of town but not too far--it's a drive of a few hours or less     64
Thanksgiving is out of town and far away--I have to drive several hours or fly       16
Name: How far will you travel for Thanksgiving?, dtype: int64

In [86]:
over_150k = data['int_income'] > 150000
filter_over_150k = data[over_150k]
filter_over_150k['How far will you travel for Thanksgiving?'].value_counts()


Out[86]:
Thanksgiving is happening at my home--I won't travel at all                         49
Thanksgiving is local--it will take place in the town I live in                     25
Thanksgiving is out of town but not too far--it's a drive of a few hours or less    16
Thanksgiving is out of town and far away--I have to drive several hours or fly      12
Name: How far will you travel for Thanksgiving?, dtype: int64

In [87]:
proportion_home_50k = 106/(106 + 92 + 64 + 16)
proportion_home_150k = 49/(49 + 25 + 16 + 12)
print(proportion_home_50k)
print(proportion_home_150k)


0.381294964028777
0.4803921568627451

A greater proportion of people making higher income had Thanksgiving in their homes.

Are people who meet up with friends for Thanksgiving younger?


In [88]:
thanksgiving_meet_friends = 'Have you ever tried to meet up with hometown friends on Thanksgiving night?'
thanksgiving_friendsgiving = 'Have you ever attended a "Friendsgiving?"'

data.pivot_table(index = thanksgiving_meet_friends, columns = thanksgiving_friendsgiving, values = "int_age")


Out[88]:
Have you ever attended a "Friendsgiving?" No Yes
Have you ever tried to meet up with hometown friends on Thanksgiving night?
No 42.283702 37.010526
Yes 41.475410 33.976744

People who have met up with friends are generally younger (ie. 34 vs. 41 for people who haven't).

What is the most commonly eaten dessert?


In [89]:
import re

desserts = 'Which of these desserts do you typically have at Thanksgiving dinner?'
column_headings = data.columns
desserts_index = [i for i,x in enumerate(column_headings) if re.match(desserts,x)]

counts = data[desserts_index].count()
counts.sort_values(ascending = False)


Out[89]:
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - None                        295
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Ice cream                   266
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Cookies                     204
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Cheesecake                  191
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Other (please specify).1    134
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Other (please specify)      134
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Brownies                    128
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Apple cobbler               110
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Peach cobbler               103
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Carrot cake                  72
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Fudge                        43
Which of these desserts do you typically have at Thanksgiving dinner? Please select all that apply.   - Blondies                     16
dtype: int64

The most common dessert is ice cream followed by cookies.

Are there regional patterns in dinner menus?


In [90]:
region_counts = data['US Region'].value_counts().sort_index()
print(region_counts)


data["US Region"] = data["US Region"].astype("category")
data["US Region"].cat.set_categories(['East North Central', 'East South Central', 'Middle Atlantic', 
                                      'Mountain','New England','Pacific','South Atlantic',
                                      'West North Central','West South Central'],inplace=True)
data["What is typically the main dish at your Thanksgiving dinner?"] = data["What is typically the main dish at your Thanksgiving dinner?"].astype("category")
data["What is typically the main dish at your Thanksgiving dinner?"].cat.set_categories(['Chicken', 'I don\'t know','Other (please specify)', 'Roast beef', 'Tofurkey', 'Turducken', 'Turkey', 'Ham/Pork'],inplace=True)

main_dish = pd.pivot_table(data,index = [ "What is typically the main dish at your Thanksgiving dinner?"], columns =['US Region'], values=["RespondentID"], aggfunc=lambda x: len(x.unique()), fill_value = 0, margins = True )


main_dish_normalized = main_dish.div( main_dish.iloc[-1,:], axis=1 )

main_dish_normalized


East North Central    145
East South Central     56
Middle Atlantic       145
Mountain               41
New England            55
Pacific               130
South Atlantic        203
West North Central     71
West South Central     85
Name: US Region, dtype: int64
Out[90]:
RespondentID
US Region East North Central East South Central Middle Atlantic Mountain New England Pacific South Atlantic West North Central West South Central All
What is typically the main dish at your Thanksgiving dinner?
Chicken 0.000000 0.000000 0.006897 0.024390 0.036364 0.000000 0.014778 0.014085 0.011765 0.009667
I don't know 0.000000 0.000000 0.000000 0.000000 0.000000 0.007692 0.000000 0.014085 0.000000 0.002148
Other (please specify) 0.034483 0.071429 0.027586 0.000000 0.018182 0.069231 0.029557 0.042254 0.035294 0.037594
Roast beef 0.000000 0.017857 0.013793 0.000000 0.000000 0.007692 0.014778 0.000000 0.000000 0.007519
Tofurkey 0.006897 0.000000 0.034483 0.048780 0.018182 0.030769 0.014778 0.028169 0.023529 0.021482
Turducken 0.000000 0.000000 0.006897 0.000000 0.000000 0.015385 0.000000 0.000000 0.000000 0.003222
Turkey 0.931034 0.892857 0.896552 0.902439 0.927273 0.823077 0.891626 0.845070 0.905882 0.889366
Ham/Pork 0.027586 0.017857 0.013793 0.024390 0.000000 0.046154 0.034483 0.056338 0.023529 0.029001
All 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000