You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'What is the correct syntax to multiply <code>Column_A</code> and <code>Column_B</code> from dataframe <code>df</code> and save it as a new column named <code>new_column</code>?',
40
40
{
41
-
'<code>df = df.assign(’new_column’=df[’Column_A’] * df[’Column_B’])</code></code>':'Do you need to put your new column name in between quotations?',
42
-
'<code>df = df.assign(new_column=df[’Column_A’] * df[’Column_B’])</code>':'You must have been paying attention.',
43
-
'<code>df = df.assign[new_column=df(’Column_A’) * df(’Column_B’)]</code>':'Are you sure that you are using the correct parentheses for this?',
41
+
'<code>df = df.assign(\'new_column\'=df[\'Column_A\'] * df[\'Column_B\'])</code></code>':'Do you need to put your new column name in between quotations?',
42
+
'<code>df = df.assign(new_column=df[\'Column_A\'] * df[\'Column_B\'])</code>':'You must have been paying attention.',
43
+
'<code>df = df.assign[new_column=df(\'Column_A\') * df(\'Column_B\')]</code>':'Are you sure that you are using the correct parentheses for this?',
Copy file name to clipboardExpand all lines: modules/module2/module2-17-filtering_question.qmd
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ df['location'] == 'Canada'
19
19
is
20
20
21
21
```out
22
-
[True, False, False, True]
22
+
[True, False, False, True]
23
23
```
24
24
25
25
<br>
@@ -218,7 +218,7 @@ mighty_pokemon
218
218
generateQuiz(
219
219
'mcq3',
220
220
'Question',
221
-
'Which type has the most Pokemon with attack and defense scores greater than 100? <i>(Hint: Think about how we counted the frequency of categorical columns in module 1)</i>',
221
+
'Which type has the most Pokemon with attack and defense scores greater than 100? <i>(Hint: Think about how we counted the frequency of categorical columns in module 1).</i>',
222
222
{
223
223
'Rock and Bug':'Well done!',
224
224
'Water and Rock':'You can use <code>mighty_pokemon[\'type\'].value_counts()</code> to find out.',
0 commit comments