From ecac35d44972a431d080cd3bb1979a234934ab8c Mon Sep 17 00:00:00 2001 From: Jim Bennett Date: Tue, 14 Feb 2023 18:03:34 -0800 Subject: [PATCH] Adding bar chart by price --- 2-Regression/3-Linear/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/2-Regression/3-Linear/README.md b/2-Regression/3-Linear/README.md index 8601abde3..7012eb622 100644 --- a/2-Regression/3-Linear/README.md +++ b/2-Regression/3-Linear/README.md @@ -122,7 +122,15 @@ for i,var in enumerate(new_pumpkins['Variety'].unique()): Scatter plot of Price vs. Day of Year -Our investigation suggests that variety has more effect on the overall price than the actual selling date. So let us focus for the moment only on one pumpkin variety, and see what effect the date has on the price: +Our investigation suggests that variety has more effect on the overall price than the actual selling date. We can see this with a bar graph: + +```python +new_pumpkins.groupby('Variety')['Price'].mean().plot(kind='bar') +``` + +Scatter plot of Price vs. Day of Year + +Let us focus for the moment only on one pumpkin variety, the 'pie type', and see what effect the date has on the price: ```python pie_pumpkins = new_pumpkins[new_pumpkins['Variety']=='PIE TYPE']