Reorganize the Taste dataframe so that each of the four tastes (Salty, Sour, Sweet and Bitter) become
Question:
Reorganize the Taste dataframe so that each of the four tastes (Salty, Sour, Sweet and Bitter) become values of a new column called Taste_type. A new column, called Taste_order will also be created to indicate if a given taste is a first or second taste for each chocolate.
b. The resulting Taste dataframe has rows with missing values which can be an issue for further data analysis.
Remove any rows that have a missing value.
c. We can now combine the data frames CompetitionChocolate and Taste to obtain a more complete view of the data. Combine the two dataframe using the column Ref from CompetitionChocolate and ChocolateID from Taste.
The resulting data frame should be called Chocolate.
Remove the column ChocolateID from Chocolate.
A correct version of the Chocolate dataframe can be found in the file Chocolate _Q5.csv Feel free to use it for the remaining questions.
Q2
Using the Chocolate dataframe write the code:
List the company name(s) having a chocolate containing salt but without a salty first taste
For each company location, indicate the average number of ingredients used and how many of each taste type (bitter, sour, salty and sweet) are a first taste.
Q 3
Using the Chocolate dataframe, use the data model of your choice and the predictors of your choice to derive a model predicting a chocolate rating.
Rearrange the dataframe if necessary.
Governmental and Nonprofit Accounting
ISBN: 978-0132751261
10th edition
Authors: Robert Freeman, Craig Shoulders, Gregory Allison, Robert Smi