Visualizing and testing preservation methods
As a food scientist, you're tasked with evaluating the effectiveness of different preservation methods on nutrient retention and how these methods impact shelf life. You have been provided with a dataset, food_preservation
, that includes various types of food preserved by methods such as freezing and canning. Each entry in the dataset captures the nutrient retention and calculated shelf life for these foods, providing a unique opportunity to analyze the impacts of preservation techniques on food quality.
The following imports have been loaded for you in addition to food_preservation
:
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu
This exercise is part of the course
Experimental Design in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Filter to Freezing and Canning data
condensed_food_data = food_preservation[food_preservation['PreservationMethod'].____(['____', '____'])]
# Create a violin plot for nutrient retention by preservation method
____(data=food_preservation,
x="____",
y="____")
plt.show()