F01.justanswer.com



Question 4: use the cereals_data3 for all these questions. Use the .groupby() method of the DataFrame to find the mean of the 'Cal', 'Protein', 'Fat', 'Sodium', 'Fiber', 'Carbo', 'Sugars', 'Potass', 'Vit', 'Shelf', 'Weight', and 'Cups' columns by manufacturer (or Manuf). Paste a screenshot of your code and outputUse the .groupby() method of the DataFrame to find the counts, mean, variance, standard deviation, minimum value, and maximum value, of the 'Cal', 'Protein', 'Fat', 'Sodium', 'Fiber', 'Carbo', columns by manufacturer (or Manuf). Paste a screenshot of your code and outputDefine a function called descriptive, that takes in a DataFrame with quantitative columns as input and returns the descriptive statistics of each column. You can use the .agg() method to create this function. The results should be the same just as when you use a groupby() method. The descriptive statistics used should include “mean”, median”, “variance”, “standard deviation”, “maximum value”, “minimum value”, “skewness”, and “kurtosis”. Then, select the 'Fiber', 'Carbo', 'Sugars', and 'Potass', columns and use the .apply() method to apply your descriptive function to the selected DataFrame so that the descriptive statistics for that DataFrame is generated. Paste a screenshot of your code and outputUse a pivot table to generate the same results as in (b) above. Paste a screenshot of your code and outputCreate a cross tabulation using the Manuf and the Shelf columns to find the relationship and interaction between these variables in terms of counts or frequencies. Paste a screenshot of your code and outputCreate a cross tabulation using the Manuf and the Shelf columns to find the relationship and interaction between these variables in terms of relative frequencies. Paste a screenshot of your code and outputBased on the cross tabulation on question (e) above, what is the probability of having the “K” manufacturer’s cereals on shelf “two” (or 2)? Write a code to select and output that value. Paste a screenshot of your code and output ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download