Skip to content

Commit 6e8f219

Browse files
authored
Merge branch 'master' into quarto_mod5
2 parents a7d64dd + e943d4d commit 6e8f219

File tree

90 files changed

+11212
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+11212
-17
lines changed

_quarto.yml

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,87 @@ website:
7979
- text: '   12.1. Exercises'
8080
href: modules/module1/module1-32-practicing_bar_charts.qmd
8181
- href: modules/module1/module1-34-what_did_we_just_learn.qmd
82+
- section: "**M2. Not So Scary Wrangling (Table Manipulation and Chaining)**"
83+
contents:
84+
- href: modules/module2/module2-00-module_learning_outcomes.qmd
85+
- href: modules/module2/module2-01-reading_in_different_file_types.qmd
86+
- text: '   1.1. Exercises'
87+
href: modules/module2/module2-02-delimiter.qmd
88+
- href: modules/module2/module2-06-arguments_for_reading_data.qmd
89+
- text: '   2.1. Exercises'
90+
href: modules/module2/module2-07-name_that_argument.qmd
91+
- href: modules/module2/module2-09-column_renaming_and_dropping.qmd
92+
- text: '   3.1. Exercises'
93+
href: modules/module2/module2-10-column_editing_questions.qmd
94+
- href: modules/module2/module2-13-column_arithmetic_and_creation.qmd
95+
- text: '   4.1. Exercises'
96+
href: modules/module2/module2-14-column_arithmetic_questions.qmd
97+
- href: modules/module2/module2-16-data_filtering.qmd
98+
- text: '   5.1. Exercises'
99+
href: modules/module2/module2-17-filtering_question.qmd
100+
- href: modules/module2/module2-20-conditional_value_replacement.qmd
101+
- text: '   6.1. Exercises'
102+
href: modules/module2/module2-21-practice_replacing_values.qmd
103+
- href: modules/module2/module2-22-chaining_notation.qmd
104+
- text: '   7.1. Exercises'
105+
href: modules/module2/module2-23-chaining_true_false.qmd
106+
- href: modules/module2/module2-25-grouping_and_aggregating.qmd
107+
- text: '   8.1. Exercises'
108+
href: modules/module2/module2-26-fruit_salad_grouping_and_aggregating.qmd
109+
- href: modules/module2/module2-29-plotting_with_altair.qmd
110+
- text: '   9.1. Exercises'
111+
href: modules/module2/module2-30-plotting_a_groupby_object.qmd
112+
- href: modules/module2/module2-31-what_did_we_just_learn.qmd
113+
- section: "**M3. Tidy Data and Joining Dataframes**"
114+
contents:
115+
- href: modules/module3/module3-00-module_learning_outcomes.qmd
116+
- href: modules/module3/module3-01-what_is_tidy_data.qmd
117+
- text: '   1.1. Exercises'
118+
href: modules/module3/module3-02-tidy_data_questions.qmd
119+
- href: modules/module3/module3-05-statistical_questions_and_tidy_data.qmd
120+
- text: '   2.1. Exercises'
121+
href: modules/module3/module3-06-which_is_tidy.qmd
122+
- href: modules/module3/module3-08-reshaping_with_pivot.qmd
123+
- text: '   3.1. Exercises'
124+
href: modules/module3/module3-09-pivoting_questions.qmd
125+
- href: modules/module3/module3-11-reshaping_with_pivot_table.qmd
126+
- text: '   4.1. Exercises'
127+
href: modules/module3/module3-12-pivot_table_questions.qmd
128+
- href: modules/module3/module3-14-reshaping_with_melt.qmd
129+
- text: '   5.1. Exercises'
130+
href: modules/module3/module3-15-melting_questions.qmd
131+
- href: modules/module3/module3-17-concatenation.qmd
132+
- text: '   6.1. Exercises'
133+
href: modules/module3/module3-18-concat_questions.qmd
134+
- href: modules/module3/module3-21-joining_dataframes_using_merge.qmd
135+
- text: '   7.1. Exercises'
136+
href: modules/module3/module3-22-merge_questions.qmd
137+
- href: modules/module3/module3-25-what_did_we_just_learn.qmd
138+
- section: "**M4. Python Without the \"Eek\" (Basic Python)**"
139+
contents:
140+
- href: modules/module4/module4-00-module_learning_outcomes.qmd
141+
- href: modules/module4/module4-01-python_data_types.qmd
142+
- text: '   1.1. Exercises'
143+
href: modules/module4/module4-02-name_that_data_type.qmd
144+
- href: modules/module4/module4-05-python_data_structures:_lists_tuples_and_sets.qmd
145+
- text: '   2.1. Exercises'
146+
href: modules/module4/module4-06-name_that_data_structure.qmd
147+
- href: modules/module4/module4-10-python_data_structures:_dictionaries.qmd
148+
- text: '   3.1. Exercises'
149+
href: modules/module4/module4-11-dictionary_questions.qmd
150+
- href: modules/module4/module4-14-dataframes_series_and_column_dtypes.qmd
151+
- text: '   4.1. Exercises'
152+
href: modules/module4/module4-15-name_that_type_dtype.qmd
153+
- href: modules/module4/module4-18-python_operations.qmd
154+
- text: '   5.1. Exercises'
155+
href: modules/module4/module4-19-output_or_error_with_operations.qmd
156+
- href: modules/module4/module4-21-operations_with_columns.qmd
157+
- text: '   6.1. Exercises'
158+
href: modules/module4/module4-22-whats_that_output_with_column_operations.qmd
159+
- href: modules/module4/module4-23-splitting_a_column.qmd
160+
- text: '   7.1. Exercises'
161+
href: modules/module4/module4-24-practice_operations_with_dataframe_columns.qmd
162+
- href: modules/module4/module4-25-what_did_we_just_learn.qmd
82163
- section: "**Module 5: Making Choices and Repeating Iterations**"
83164
contents:
84165
- href: modules/module5/module5-00-module_learning_outcomes.qmd
@@ -141,4 +222,4 @@ format:
141222
history: false
142223
menu: false
143224
execute:
144-
echo: true
225+
echo: true

data/candy_bars2.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name,calories,fat,sugar
2+
Coffee Crisp,260,13,25
3+
Butterfinger,798,30,72
4+
Skor,209,12,23
5+
Smarties,210,6,33
6+
Twix,250,12,25

data/candybars-h.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This dataset was created by Hayley Boyce in February 2020.,,,,,,,,,,Note this is not a complete dataset and there are many other candybars that are in existance ,,,,,,,,,,name,weight,chocolate,peanuts,caramel,nougat,cookie_wafer_rice,coconut,white_chocolate,multi,available_canada_americaCoffee Crisp,50,1,0,0,0,1,0,0,0,CanadaButterfinger,184,1,1,1,0,0,0,0,0,AmericaSkor,39,1,0,1,0,0,0,0,0,BothSmarties,45,1,0,0,0,0,0,0,1,CanadaTwix,58,1,0,1,0,1,0,0,1,BothReeses Peanutbutter Cups ,43,1,1,0,0,0,0,0,1,Both3 Musketeers,54,1,0,0,1,0,0,0,0,AmericaKinder Surprise,20,1,0,0,0,0,0,1,0,CanadaM & M,48,1,1,0,0,0,0,0,1,BothGlosettes,50,1,0,0,0,0,0,0,1,CanadaKitKat,45,1,0,0,0,1,0,0,1,BothBabe Ruth,60,1,1,1,1,0,0,0,0,AmericaCaramilk,52,1,0,1,0,0,0,0,0,CanadaAero,42,1,0,0,0,0,0,0,0,CanadaMars,51,1,0,1,1,0,0,0,0,BothPayday,52,0,1,1,0,0,0,0,0,AmericaSnickers,48,1,1,1,1,0,0,0,0,BothCrunchie,26,1,0,0,0,0,0,0,0,CanadaWonderbar ,58,1,1,1,0,0,0,0,0,Canada100 Grand ,43,1,0,1,0,1,0,0,0,AmericaTake 5,43,1,1,1,0,1,0,0,0,AmericaWhatchamacallits,45,1,1,0,0,1,0,0,0,AmericaAlmond Joy,46,1,0,0,0,0,1,0,0,AmericaOh Henry,51,1,1,1,0,0,0,0,0,BothCookies and Cream,43,0,0,0,0,1,0,1,0,Both

data/candybars-text.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name weight chocolate peanuts caramel nougat cookie_wafer_rice coconut white_chocolate multi available_canada_america
2+
Coffee Crisp 50 1 0 0 0 1 0 0 0 Canada
3+
Butterfinger 184 1 1 1 0 0 0 0 0 America
4+
Skor 39 1 0 1 0 0 0 0 0 Both
5+
Smarties 45 1 0 0 0 0 0 0 1 Canada
6+
Twix 58 1 0 1 0 1 0 0 1 Both
7+
Reeses Peanutbutter Cups 43 1 1 0 0 0 0 0 1 Both
8+
3 Musketeers 54 1 0 0 1 0 0 0 0 America
9+
Kinder Surprise 20 1 0 0 0 0 0 1 0 Canada
10+
M & M 48 1 1 0 0 0 0 0 1 Both
11+
Glosettes 50 1 0 0 0 0 0 0 1 Canada
12+
KitKat 45 1 0 0 0 1 0 0 1 Both
13+
Babe Ruth 60 1 1 1 1 0 0 0 0 America
14+
Caramilk 52 1 0 1 0 0 0 0 0 Canada
15+
Aero 42 1 0 0 0 0 0 0 0 Canada
16+
Mars 51 1 0 1 1 0 0 0 0 Both
17+
Payday 52 0 1 1 0 0 0 0 0 America
18+
Snickers 48 1 1 1 1 0 0 0 0 Both
19+
Crunchie 26 1 0 0 0 0 0 0 0 Canada
20+
Wonderbar 58 1 1 1 0 0 0 0 0 Canada
21+
100 Grand 43 1 0 1 0 1 0 0 0 America
22+
Take 5 43 1 1 1 0 1 0 0 0 America
23+
Whatchamacallits 45 1 1 0 0 1 0 0 0 America
24+
Almond Joy 46 1 0 0 0 0 1 0 0 America
25+
Oh Henry 51 1 1 1 0 0 0 0 0 Both
26+
Cookies and Cream 43 0 0 0 0 1 0 1 0 Both

data/cereal2.csv

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name,mfr_type,type,calories,protein,fat,sodium,fiber,carbo,sugars,potass,vitamins,shelf,weight,cups,rating
2+
100% Bran,N-Cold,Cold,70,4,1,130,10,5,6,280,25,3,1,0.33,68.402973
3+
100% Natural Bran,Q-Cold,Cold,120,3,5,15,2,8,8,135,0,3,1,1,33.983679
4+
All-Bran,K-Cold,Cold,70,4,1,260,9,7,5,320,25,3,1,0.33,59.425505
5+
All-Bran with Extra Fiber,K-Cold,Cold,50,4,0,140,14,8,0,330,25,3,1,0.5,93.704912
6+
Almond Delight,R-Cold,Cold,110,2,2,200,1,14,8,1,25,3,1,0.75,34.384843
7+
Apple Cinnamon Cheerios,G-Cold,Cold,110,2,2,180,1.5,10.5,10,70,25,1,1,0.75,29.509541
8+
Apple Jacks,K-Cold,Cold,110,2,0,125,1,11,14,30,25,2,1,1,33.174094
9+
Basic 4,G-Cold,Cold,130,3,2,210,2,18,8,100,25,3,1.33,0.75,37.038562
10+
Bran Chex,R-Cold,Cold,90,2,1,200,4,15,6,125,25,1,1,0.67,49.120253
11+
Bran Flakes,P-Cold,Cold,90,3,0,210,5,13,5,190,25,3,1,0.67,53.313813
12+
Cap'n'Crunch,Q-Cold,Cold,120,1,2,220,0,12,12,35,25,2,1,0.75,18.042851
13+
Cheerios,G-Cold,Cold,110,6,2,290,2,17,1,105,25,1,1,1.25,50.764999
14+
Cinnamon Toast Crunch,G-Cold,Cold,120,1,3,210,0,13,9,45,25,2,1,0.75,19.823573
15+
Clusters,G-Cold,Cold,110,3,2,140,2,13,7,105,25,3,1,0.5,40.400208
16+
Cocoa Puffs,G-Cold,Cold,110,1,1,180,0,12,13,55,25,2,1,1,22.736446
17+
Corn Chex,R-Cold,Cold,110,2,0,280,0,22,3,25,25,1,1,1,41.445019
18+
Corn Flakes,K-Cold,Cold,100,2,0,290,1,21,2,35,25,1,1,1,45.863324
19+
Corn Pops,K-Cold,Cold,110,1,0,90,1,13,12,20,25,2,1,1,35.782791
20+
Count Chocula,G-Cold,Cold,110,1,1,180,0,12,13,65,25,2,1,1,22.396513
21+
Cracklin' Oat Bran,K-Cold,Cold,110,3,3,140,4,10,7,160,25,3,1,0.5,40.448772
22+
Cream of Wheat (Quick),N-Hot,Hot,100,3,0,80,1,21,0,1,0,2,1,1,64.533816
23+
Crispix,K-Cold,Cold,110,2,0,220,1,21,3,30,25,3,1,1,46.895644
24+
Crispy Wheat & Raisins,G-Cold,Cold,100,2,1,140,2,11,10,120,25,3,1,0.75,36.176196
25+
Double Chex,R-Cold,Cold,100,2,0,190,1,18,5,80,25,3,1,0.75,44.330856
26+
Froot Loops,K-Cold,Cold,110,2,1,125,1,11,13,30,25,2,1,1,32.207582
27+
Frosted Flakes,K-Cold,Cold,110,1,0,200,1,14,11,25,25,1,1,0.75,31.435973
28+
Frosted Mini-Wheats,K-Cold,Cold,100,3,0,0,3,14,7,100,25,2,1,0.8,58.345141
29+
Fruit & Fibre Dates; Walnuts; and Oats,P-Cold,Cold,120,3,2,160,5,12,10,200,25,3,1.25,0.67,40.917047
30+
Fruitful Bran,K-Cold,Cold,120,3,0,240,5,14,12,190,25,3,1.33,0.67,41.015492
31+
Fruity Pebbles,P-Cold,Cold,110,1,1,135,0,13,12,25,25,2,1,0.75,28.025765
32+
Golden Crisp,P-Cold,Cold,100,2,0,45,0,11,15,40,25,1,1,0.88,35.252444
33+
Golden Grahams,G-Cold,Cold,110,1,1,280,0,15,9,45,25,2,1,0.75,23.804043
34+
Grape Nuts Flakes,P-Cold,Cold,100,3,1,140,3,15,5,85,25,3,1,0.88,52.076897
35+
Grape-Nuts,P-Cold,Cold,110,3,0,170,3,17,3,90,25,3,1,0.25,53.371007
36+
Great Grains Pecan,P-Cold,Cold,120,3,3,75,3,13,4,100,25,3,1,0.33,45.811716
37+
Honey Graham Ohs,Q-Cold,Cold,120,1,2,220,1,12,11,45,25,2,1,1,21.871292
38+
Honey Nut Cheerios,G-Cold,Cold,110,3,1,250,1.5,11.5,10,90,25,1,1,0.75,31.072217
39+
Honey-comb,P-Cold,Cold,110,1,0,180,0,14,11,35,25,1,1,1.33,28.742414
40+
Just Right Crunchy Nuggets,K-Cold,Cold,110,2,1,170,1,17,6,60,100,3,1,1,36.523683
41+
Just Right Fruit & Nut,K-Cold,Cold,140,3,1,170,2,20,9,95,100,3,1.3,0.75,36.471512
42+
Kix,G-Cold,Cold,110,2,1,260,0,21,3,40,25,2,1,1.5,39.241114
43+
Life,Q-Cold,Cold,100,4,2,150,2,12,6,95,25,2,1,0.67,45.328074
44+
Lucky Charms,G-Cold,Cold,110,2,1,180,0,12,12,55,25,2,1,1,26.734515
45+
Maypo,A-Hot,Hot,100,4,1,0,0,16,3,95,25,2,1,1,54.850917
46+
Muesli Raisins; Dates; & Almonds,R-Cold,Cold,150,4,3,95,3,16,11,170,25,3,1,1,37.136863
47+
Muesli Raisins; Peaches; & Pecans,R-Cold,Cold,150,4,3,150,3,16,11,170,25,3,1,1,34.139765
48+
Mueslix Crispy Blend,K-Cold,Cold,160,3,2,150,3,17,13,160,25,3,1.5,0.67,30.313351
49+
Multi-Grain Cheerios,G-Cold,Cold,100,2,1,220,2,15,6,90,25,1,1,1,40.105965
50+
Nut&Honey Crunch,K-Cold,Cold,120,2,1,190,0,15,9,40,25,2,1,0.67,29.924285
51+
Nutri-Grain Almond-Raisin,K-Cold,Cold,140,3,2,220,3,21,7,130,25,3,1.33,0.67,40.69232
52+
Nutri-grain Wheat,K-Cold,Cold,90,3,0,170,3,18,2,90,25,3,1,1,59.642837
53+
Oatmeal Raisin Crisp,G-Cold,Cold,130,3,2,170,1.5,13.5,10,120,25,3,1.25,0.5,30.450843
54+
Post Nat. Raisin Bran,P-Cold,Cold,120,3,1,200,6,11,14,260,25,3,1.33,0.67,37.840594
55+
Product 19,K-Cold,Cold,100,3,0,320,1,20,3,45,100,3,1,1,41.50354
56+
Puffed Rice,Q-Cold,Cold,50,1,0,0,0,13,0,15,0,3,0.5,1,60.756112
57+
Puffed Wheat,Q-Cold,Cold,50,2,0,0,1,10,0,50,0,3,0.5,1,63.005645
58+
Quaker Oat Squares,Q-Cold,Cold,100,4,1,135,2,14,6,110,25,3,1,0.5,49.511874
59+
Quaker Oatmeal,Q-Hot,Hot,100,5,2,0,2.7,1,1,110,0,1,1,0.67,50.828392
60+
Raisin Bran,K-Cold,Cold,120,3,1,210,5,14,12,240,25,2,1.33,0.75,39.259197
61+
Raisin Nut Bran,G-Cold,Cold,100,3,2,140,2.5,10.5,8,140,25,3,1,0.5,39.7034
62+
Raisin Squares,K-Cold,Cold,90,2,0,0,2,15,6,110,25,3,1,0.5,55.333142
63+
Rice Chex,R-Cold,Cold,110,1,0,240,0,23,2,30,25,1,1,1.13,41.998933
64+
Rice Krispies,K-Cold,Cold,110,2,0,290,0,22,3,35,25,1,1,1,40.560159
65+
Shredded Wheat,N-Cold,Cold,80,2,0,0,3,16,0,95,0,1,0.83,1,68.235885
66+
Shredded Wheat 'n'Bran,N-Cold,Cold,90,3,0,0,4,19,0,140,0,1,1,0.67,74.472949
67+
Shredded Wheat spoon size,N-Cold,Cold,90,3,0,0,3,20,0,120,0,1,1,0.67,72.801787
68+
Smacks,K-Cold,Cold,110,2,1,70,1,9,15,40,25,2,1,0.75,31.230054
69+
Special K,K-Cold,Cold,110,6,0,230,1,16,3,55,25,1,1,1,53.131324
70+
Strawberry Fruit Wheats,N-Cold,Cold,90,2,0,15,3,15,5,90,25,2,1,1,59.363993
71+
Total Corn Flakes,G-Cold,Cold,110,2,1,200,0,21,3,35,100,3,1,1,38.839746
72+
Total Raisin Bran,G-Cold,Cold,140,3,1,190,4,15,14,230,100,3,1.5,1,28.592785
73+
Total Whole Grain,G-Cold,Cold,100,3,1,200,3,16,3,110,100,3,1,1,46.658844
74+
Triples,G-Cold,Cold,110,2,1,250,0,21,3,60,25,3,1,0.75,39.106174
75+
Trix,G-Cold,Cold,110,1,1,140,0,13,12,25,25,2,1,1,27.753301
76+
Wheat Chex,R-Cold,Cold,100,3,1,230,3,17,3,115,25,1,1,0.67,49.787445
77+
Wheaties,G-Cold,Cold,100,3,1,200,3,17,3,110,25,1,1,1,51.592193
78+
Wheaties Honey Gold,G-Cold,Cold,110,2,1,200,1,16,8,60,25,1,1,0.75,36.187559

data/foods.xlsx

13.8 KB
Binary file not shown.

data/snacksize_candybars.csv

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name,calories,fat,sugar
2+
Butterfinger,798,30,72
3+
Skor,209,12,23
4+
Twix,250,12,25
5+
Coffee Crisp,260,13,25
6+
Smarties,210,6,33

environment.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dependencies:
99
- scipy
1010
- matplotlib
1111
- jupyter
12-
- quarto
12+
- quarto=1.6.43
1313
- pip
14-
15-
14+
- openpyxl

modules/module1/slides/module1_29.qmd

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,19 @@ Now we can use `.value_counts()` on this `mfr_column` variable to reference it,
7777
---
7878

7979
```{python}
80-
mfr_col_wrong = cereal[['mfr']]
81-
mfr_col_wrong
80+
mfr_col_dataframe = cereal[['mfr']]
81+
mfr_col_dataframe
8282
```
8383

8484
<br>
8585

86-
```python
87-
mfr_col_wrong.value_counts()
86+
```{python}
87+
mfr_col_dataframe.value_counts()
8888
```
8989

90-
```out
91-
AttributeError: 'DataFrame' object has no attribute 'value_counts'
92-
93-
Detailed traceback:
94-
File "<string>", line 1, in <module>
95-
File "/usr/local/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in __getattr__
96-
return object.__getattribute__(self, name)
97-
```
9890

9991
:::{.notes}
100-
If we did instead use double square brackets with `pd.value_counts()`, we would get an error. So it is important to take care and remember when you are using `value_counts()`, you only use one set of square brackets.
92+
`value_counts()` can also be called on a DataFrame to count unique rows.
10193
:::
10294

10395
---
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
format:
3+
html:
4+
page-layout: full
5+
---
6+
7+
# 0. Module Learning Outcomes
8+
9+
::: {.panel-tabset .nav-pills}
10+
11+
## Video
12+
13+
<iframe
14+
class="video"
15+
src="https://www.youtube.com/embed/rn5t62Utn4U?start=0&end=29&rel=0"
16+
title="Module 2 Video - Module Learning Outcomes"
17+
frameborder="0"
18+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
19+
allowfullscreen
20+
></iframe>
21+
22+
## Slides
23+
24+
<iframe
25+
class="slide-deck"
26+
src="slides/module2_00.html"
27+
></iframe>
28+
29+
:::

0 commit comments

Comments
 (0)