fix(curriculum): convert all video challenges to markdown (#39189)

This commit is contained in:
Shaun Hamilton
2020-08-04 20:56:41 +01:00
committed by GitHub
parent e7d2028bba
commit 7d8e558b91
69 changed files with 711 additions and 345 deletions

View File

@ -7,24 +7,31 @@ videoId: nVAaxZ34khk
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-pandas-real-life-example-24fa5bf8" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: 'What does the shape of our dataframe tell us?'
text: |
What does the shape of our dataframe tell us?
answers:
- 'The size in gigabytes the dataframe we loaded into memory is.'
- 'How many rows and columns our dataframe has.'
- 'How many rows the source data had before loading.'
- 'How many columns the source data had before loading.'
- |
The size in gigabytes the dataframe we loaded into memory is.
- |
How many rows and columns our dataframe has.
- |
How many rows the source data had before loading.
- |
How many columns the source data had before loading.
solution: 2
```
</section>

View File

@ -7,21 +7,28 @@ videoId: 0kJz0q0pvgQ
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-pandas-real-life-example-24fa5bf8" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: 'What does the <code>loc</code> method allow you to do?'
text: |
What does the <code>loc</code> method allow you to do?
answers:
- 'Retrieve a subset of rows and columns by supplying interger-location arguments.'
- 'Access a group of rows and columns by supplying label(s) arguments.'
- 'Returns the first <code>n</code> rows based on the integer argument supplied.'
- |
Retrieve a subset of rows and columns by supplying interger-location arguments.
- |
Access a group of rows and columns by supplying label(s) arguments.
- |
Returns the first <code>n</code> rows based on the integer argument supplied.
solution: 2
```

View File

@ -7,23 +7,32 @@ videoId: mHjxzFS5_Z0
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/data-cleaning-rmotr-freecodecamp-fd76fa59" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
When using Matplotlib's global API, what does the order of numbers mean here?: `plt.subplot(1, 2, 1)`
When using Matplotlib's global API, what does the order of numbers mean here?
```py
plt.subplot(1, 2, 1)
```
answers:
- 'My figure will have one column, two rows, and I am going to start drawing in the first (left) plot.'
- 'I am going to start drawing in the first (left) plot, my figure will have two rows, and my figure will have one column.'
- 'My figure will have one row, two columns, and I am going to start drawing in the first (left) plot.'
- |
My figure will have one column, two rows, and I am going to start drawing in the first (left) plot.
- |
I am going to start drawing in the first (left) plot, my figure will have two rows, and my figure will have one column.
- |
My figure will have one row, two columns, and I am going to start drawing in the first (left) plot.
solution: 3
```
````
</section>

View File

@ -7,22 +7,28 @@ videoId: kj7QqjXhH6A
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/data-cleaning-rmotr-freecodecamp-fd76fa59" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: |
The Python method `.duplicated()` returns a boolean Series for your DataFrame. `True` is the return value for rows that:
answers:
- contain a duplicate, where the value for the row contains the first occurrence of that value.
- contain a duplicate, where the value for the row is at least the second occurrence of that value.
- contain a duplicate, where the value for the row contains either the first or second occurrence.
- |
contain a duplicate, where the value for the row contains the first occurrence of that value.
- |
contain a duplicate, where the value for the row is at least the second occurrence of that value.
- |
contain a duplicate, where the value for the row contains either the first or second occurrence.
solution: 2
```

View File

@ -7,18 +7,20 @@ videoId: ovYNhnltVxY
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/data-cleaning-rmotr-freecodecamp-fd76fa59" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
import pandas as pd
@ -30,7 +32,8 @@ question:
```
answers:
- '3'
- |
3
- |
```
0 True
@ -50,7 +53,6 @@ question:
dtype: bool
```
solution: 1
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: sTMN_pdI6S0
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/data-cleaning-rmotr-freecodecamp-fd76fa59" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
import pandas as pd
@ -59,7 +61,6 @@ question:
dtype: float64
```
solution: 2
```
````
</section>

View File

@ -7,6 +7,7 @@ videoId: h8caJq2Bb9w
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/interactive-jupyterlab-tutorial-ac5fa63f" target='_blank'>Notebook</a>
@ -14,17 +15,22 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
question:
text: What is *not* allowed in a Jupyter Notebook's cell?
text: |
What is **not** allowed in a Jupyter Notebook's cell?
answers:
- "Markdown"
- "Python code"
- "An Excel sheet"
- |
Markdown
- |
Python code
- |
An Excel sheet
solution: 3
```
</section>

View File

@ -7,24 +7,31 @@ videoId: VJrP2FUzKP0
---
## Description
<section id='description'>
More resources:
- <a href="https://docs.google.com/presentation/d/1fDpjlyMiOMJyuc7_jMekcYLPP2XlSl1eWw9F7yE7byk" target='_blank'>Slides</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: "Why should you choose R over Python for data analysis?"
text: |
Why should you choose R over Python for data analysis?
answers:
- "It's simple to learn."
- "It's better at dealing with advanced statistical methods."
- "There are many powerful libraries that support R."
- "It's free and open source."
- |
It's simple to learn.
- |
It's better at dealing with advanced statistical methods.
- |
There are many powerful libraries that support R.
- |
It's free and open source.
solution: 2
```
</section>

View File

@ -7,6 +7,7 @@ videoId: 5PPegAs9aLA
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/interactive-jupyterlab-tutorial-ac5fa63f" target='_blank'>Notebook</a>
@ -14,17 +15,22 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
question:
text: <pre>Which cells are responsible for rich display?</pre>
text: |
Which cells are responsible for rich display?
answers:
- Code Cells
- Markdown Cells
- Raw Cells
- |
Code Cells
- |
Markdown Cells
- |
Raw Cells
solution: 1
```
</section>

View File

@ -7,6 +7,7 @@ videoId: k1msxD3JIxE
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/interactive-jupyterlab-tutorial-ac5fa63f" target='_blank'>Notebook</a>
@ -14,19 +15,26 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
question:
text: "What kind of data can you import and work with in a Jupyter Notebook?"
text: |
What kind of data can you import and work with in a Jupyter Notebook?
answers:
- "Excel files."
- "CSV files."
- "XML files."
- "Data from an API."
- "All of the above."
- |
Excel files.
- |
CSV files.
- |
XML files.
- |
Data from an API.
- |
All of the above.
solution: 5
```
</section>

View File

@ -7,22 +7,30 @@ videoId: XAT97YLOKD8
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-numpy-6c285b74" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: What is the relationship between size of objects (such as lists and datatypes) in memory in Python's standard library and the NumPy library? Knowing this, what are the implications for performance?
text: |
What is the relationship between size of objects (such as lists and datatypes) in memory in Python's standard library and the NumPy library? Knowing this, what are the implications for performance?
answers:
- Standard Python objects take up much more memory to store than NumPy objects; operations on comparable standard Python and NumPy objects complete in roughly the same time.
- NumPy objects take up much more memory than standard Python objects; operations on NumPy objects complete very quickly compared to comparable objects in standard Python.
- NumPy objects take up much less memory than Standard Python objects; operations on Standard Python objects complete very quickly compared to comparable objects on NumPy Object.
- Standard Python objects take up more memory than NumPy objects; operations on NumPy objects complete very quickly compared to comparable objects in standard Python.
- |
Standard Python objects take up much more memory to store than NumPy objects; operations on comparable standard Python and NumPy objects complete in roughly the same time.
- |
NumPy objects take up much more memory than standard Python objects; operations on NumPy objects complete very quickly compared to comparable objects in standard Python.
- |
NumPy objects take up much less memory than Standard Python objects; operations on Standard Python objects complete very quickly compared to comparable objects on NumPy Object.
- |
Standard Python objects take up more memory than NumPy objects; operations on NumPy objects complete very quickly compared to comparable objects in standard Python.
solution: 4
```

View File

@ -7,18 +7,20 @@ videoId: VDYVFHBL1AM
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-numpy-6c285b74" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
A = np.array([
@ -31,21 +33,23 @@ question:
```
answers:
- "[['a' 'b']]"
- |
```python
[['a' 'b']]
```
- |
```py
[['b' 'c']
['e' 'f']
['h' 'i']]
```
- |
```
```py
[['a' 'b']
['d' 'e']
['g' 'h']]
```
solution: 3
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: N1ttsMmcVMM
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-numpy-6c285b74" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
a = np.arange(5)
@ -26,12 +28,23 @@ question:
print(a <= 3)
```
answers:
- "[False, False, False, False, True]"
- "[5]"
- "[0, 1, 2, 3]"
- "[True, True, True, True, False]"
- |
```python
[False, False, False, False, True]
```
- |
```python
[5]
```
- |
```python
[0, 1, 2, 3]
```
- |
```python
[True, True, True, True, False]
```
solution: 4
```
````
</section>

View File

@ -7,23 +7,29 @@ videoId: P-JjV6GBCmk
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-numpy-6c285b74" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: "Why is Numpy an important, but unpopular Python library?"
text: |
Why is Numpy an important, but unpopular Python library?
answers:
- "Often you won't work directly with Numpy."
- "It's is extremely slow."
- "Working with Numpy is difficult."
- |
Often you won't work directly with Numpy.
- |
It's is extremely slow.
- |
Working with Numpy is difficult.
solution: 1
```
</section>

View File

@ -7,12 +7,14 @@ videoId: YIqgrNLAZkA
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-numpy-6c285b74" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
@ -20,12 +22,15 @@ question:
text: |
About how much memory does the integer `5` consume in plain Python?
answers:
- 32 bits
- 20 bytes
- 16 bytes
- 8 bits
- |
32 bits
- |
20 bytes
- |
16 bytes
- |
8 bits
solution: 2
```
</section>

View File

@ -20,7 +20,7 @@ More resources:
````yml
question:
text: |
What is the value of `a` after you run the following code?:
What is the value of `a` after you run the following code?
```py
a = np.arange(5)
@ -28,9 +28,18 @@ question:
```
answers:
- '[20, 21, 22, 24, 24]'
- '[0, 1, 2, 3, 4]'
- '[25, 26, 27, 28, 29]'
- |
```python
[20, 21, 22, 24, 24]
```
- |
```python
[0, 1, 2, 3, 4]
```
- |
```python
[25, 26, 27, 28, 29]
```
solution: 2
````

View File

@ -7,18 +7,20 @@ videoId: BFlH0fN5xRQ
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-pandas-902ae59b" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
import pandas as pd
@ -62,7 +64,6 @@ question:
Beau 6 7
```
solution: 2
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: _sSo2XZoB3E
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-pandas-902ae59b" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?:
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?
```
Certificates Time (in months) Certificates per month
@ -49,7 +51,6 @@ question:
)
```
solution: 3
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: 7SgFBYXaiH0
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-pandas-902ae59b" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
import pandas as pd
@ -55,7 +57,6 @@ question:
Name: Ahmad, dtype: int64
```
solution: 3
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: -ZOrgV_aA9A
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-pandas-902ae59b" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
import pandas as pd
@ -54,7 +56,6 @@ question:
dtype: int64
```
solution: 3
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: 0xACW-8cZU0
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/freecodecamp-intro-to-pandas-902ae59b" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print out?:
What will the following code print out?
```py
import pandas as pd
@ -57,7 +59,6 @@ question:
Name: certificates_earned dtype: int64
```
solution: 1
```
````
</section>

View File

@ -7,6 +7,7 @@ videoId: bJaqnTWQmb0
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-csv-and-txt-files-fb829f46" target='_blank'>Reading CSVs Notebook</a>
@ -16,16 +17,22 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
question:
text: What Python library has the <code>.read_html()</code> method we can we use for parsing HTML documents and extracting tables?
text: |
What Python library has the `.read_html()` method we can we use for parsing HTML documents and extracting tables?
answers:
- 'BeautifierSoupy'
- 'WebReader'
- 'HTTP-master'
- 'Pandas'
- |
BeautifierSoupy
- |
WebReader
- |
HTTP-master
- |
Pandas
solution: 4
```

View File

@ -7,23 +7,28 @@ videoId: NzpU17ZVlUw
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/python-under-10-minutes-15addcb2" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: What is the main difference between lists and tuples in Python?
text: |
What is the main difference between lists and tuples in Python?
answers:
- Tuples are immutable.
- Lists are ordered.
- Tuples are unordered.
- |
Tuples are immutable.
- |
Lists are ordered.
- |
Tuples are unordered.
solution: 1
```
</section>

View File

@ -7,22 +7,29 @@ videoId: PrQV9JkLhb4
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/python-under-10-minutes-15addcb2" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: 'How do we define blocks of code in the body of functions in Python?'
text: |
How do we define blocks of code in the body of functions in Python?
answers:
- 'We use a set of curly braces, one on either side of each new block of our code.'
- 'We use indentation, usually right-aligned 4 spaces.'
- 'We do not denote blocks of code.'
- 'We could use curly braces or indentation to denote blocks of code.'
- |
We use a set of curly braces, one on either side of each new block of our code.
- |
We use indentation, usually right-aligned 4 spaces.
- |
We do not denote blocks of code.
- |
We could use curly braces or indentation to denote blocks of code.
solution: 2
```

View File

@ -7,23 +7,43 @@ videoId: XzosGWLafrY
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/python-under-10-minutes-15addcb2" target='_blank'>Notebook</a>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: How would you iterate over and print the keys and values of a dictionary named "user"?
text: |
How would you iterate over and print the keys and values of a dictionary named `user`?
answers:
- '<pre>for key in user.items():<br> print(key)</pre>'
- '<pre>for key, value in user.all():<br> print(key, value)<br> print(value)'
- '<pre>for key, value in user.items():<br> print(key, value)</pre>'
- '<pre>for key, value in user<br> print(key, value)</pre>'
- |
```python
for key in user.items():
print(key)
```
- |
```python
for key, value in user.all():
print(key, value)
print(value)
```
- |
```python
for key, value in user.items():
print(key, value)
```
- |
```python
for key, value in user
print(key, value)
```
solution: 3
```
````
</section>

View File

@ -7,6 +7,7 @@ videoId: ViGEv0zOzUk
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-csv-and-txt-files-fb829f46" target='_blank'>Reading CSVs Notebook</a>
@ -16,18 +17,35 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: 'How would you import the CSV file "data.csv" and store it in a DataFrame using the Pandas module?'
text: |
How would you import the CSV file `data.csv` and store it in a DataFrame using the Pandas module?
answers:
- '<pre>import pandas as pd<br>df = pd.csv("data.csv")</pre>'
- '<pre>import pandas as pd<br>df = pd.read_csv("data.csv")</pre>'
- '<pre>import pandas as pd<br>pd.read_csv("data.csv")</pre>'
- '<pre>import pandas as pd<br>df = pd.csv_reader("data.csv")</pre>'
- |
```python
import pandas as pd
df = pd.csv("data.csv")
```
- |
```python
import pandas as pd
df = pd.read_csv("data.csv")
```
- |
```python
import pandas as pd
pd.read_csv("data.csv")
```
- |
```python
import pandas as pd
df = pd.csv_reader("data.csv")
```
solution: 2
```
````
</section>

View File

@ -7,6 +7,7 @@ videoId: MtgXS1MofRw
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-csv-and-txt-files-fb829f46" target='_blank'>Reading CSVs Notebook</a>
@ -16,15 +17,20 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
question:
text: What method does a <code>Cursor</code> instance have and what does it allow?
text: |
What method does a `Cursor` instance have and what does it allow?
answers:
- The <code>Cursor</code> instance has a <code>.run()</code> method which allows you to run SQL queries.
- The <code>Cursor</code> instance has a <code>.select()</code> method which allows you to select records.
- The <code>Cursor</code> instance has an <code>.execute()</code> method which will receive SQL parameters to run against the database.
- |
The `Cursor` instance has a `.run()` method which allows you to run SQL queries.
- |
The `Cursor` instance has a `.select()` method which allows you to select records.
- |
The `Cursor` instance has an `.execute()` method which will receive SQL parameters to run against the database.
solution: 3
```

View File

@ -7,6 +7,7 @@ videoId: cDnt02BcHng
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-csv-and-txt-files-fb829f46" target='_blank'>Reading CSVs Notebook</a>
@ -16,9 +17,10 @@ More resources:
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
Given a file named `certificates.csv` with these contents:
@ -58,14 +60,12 @@ question:
C: `certs_num`
- |
A: `'certificates'`
B: `'$'`
C: `certs_num`
solution: 2
```
````
</section>

View File

@ -7,16 +7,18 @@ videoId: v-7Y7koJ_N0
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What code would change the values in the 3rd column of both of the following Numpy arrays to 20?:
What code would change the values in the 3rd column of both of the following Numpy arrays to 20?
```py
a = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
@ -27,15 +29,22 @@ question:
```
answers:
- |
`a[:, 3] = 20`
```python
a[:, 3] = 20
```
- |
`a[2, :] = 20`
```python
a[2, :] = 20
```
- |
`a[:, 2] = 20`
```python
a[:, 2] = 20
```
- |
`a[1, 2] = 20`
```python
a[1, 2] = 20
```
solution: 3
```
````
</section>

View File

@ -7,21 +7,41 @@ videoId: f9QrZrKQMLI
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: 'What will the following code print?:<pre>b = np.array([[1.0,2.0,3.0],[3.0,4.0,5.0]])<br>print(b)</pre>'
text: |
What will the following code print?
```python
b = np.array([[1.0,2.0,3.0],[3.0,4.0,5.0]])
print(b)
```
answers:
- '<pre>[[1.0 2.0 3.0]<br>[3.0 4.0 5.0]]<pre>'
- '<pre>[[1. 2. 3.]<br>[3. 4. 5.]]<pre>'
- '<pre>[[1. 3.]<br>[2. 4.]<br>[3. 5.]<pre>'
- |
```python
[[1.0 2.0 3.0]
[3.0 4.0 5.0]]
```
- |
```python
[[1. 2. 3.]
[3. 4. 5.]]
```
- |
```python
[[1. 3.]
[2. 4.]
[3. 5.]
```
solution: 2
```
````
</section>

View File

@ -7,16 +7,18 @@ videoId: iIoQ0_L0GvA
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What is the value of `a` after running the following code?:
What is the value of `a` after running the following code?
```py
import numpy as np
@ -28,13 +30,18 @@ question:
answers:
- |
`[1 2 3 4 5]`
```python
[1 2 3 4 5]
```
- |
`[1 2 20 4 5]`
```python
[1 2 20 4 5]
```
- |
`[1 20 3 4 5]`
```python
[1 20 3 4 5]
```
solution: 2
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: 0jGfH8BPfOk
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What is another way to produce the following array?:
What is another way to produce the following array?
```
```py
[[1. 1. 1. 1. 1.]
[1. 0. 0. 0. 1.]
[1. 0. 9. 0. 1.]
@ -55,7 +57,6 @@ question:
output[4:1, 4:1] = z
```
solution: 1
```
````
</section>

View File

@ -7,16 +7,18 @@ videoId: CEykdsKT4U4
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What will the following code print?:
What will the following code print?
```py
a = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
@ -25,21 +27,20 @@ question:
```
answers:
- |
```
```py
[[100 100 100 100 100]]
```
- |
```
```py
[[100 100 100 100 100]
[100 100 100 100 100]]
```
- |
```
```py
[[ 1 2 3 4 5]
[ 6 7 20 9 10]]
```
solution: 2
```
````
</section>

View File

@ -7,13 +7,15 @@ videoId: tUdBZ7pF8Jg
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
Given a file named `data.txt` with these contents:
@ -23,7 +25,7 @@ question:
15,88,5,75,22
```
What code would produce the following array?:
What code would produce the following array?
```py
[29. 32. 45. 15. 5. 22.]
@ -31,28 +33,27 @@ question:
answers:
- |
```
```py
filedata = np.genfromtxt('data.txt', delimiter=',')
output = np.any(filedata < 50)
print(output)
```
- |
```
```py
filedata = np.genfromtxt('data.txt', delimiter=',')
output = np.all(filedata < 50, axis=1)
print(output)
```
- |
```
```py
filedata = np.genfromtxt('data.txt', delimiter=',')
output = filedata[filedata < 50]
print(output)
```
solution: 3
```
````
</section>

View File

@ -7,16 +7,18 @@ videoId: 7txegvyhtVk
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What is the value of `b` after running the following code?:
What is the value of `b` after running the following code?
```py
import numpy as np
@ -26,12 +28,23 @@ question:
```
answers:
- '10'
- '7'
- '5'
- '15'
- |
```py
10
```
- |
```py
7
```
- |
```py
5
```
- |
```py
15
```
solution: 4
```
````
</section>

View File

@ -7,18 +7,20 @@ videoId: VNWAQbEM-C8
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
````yml
question:
text: |
What code would produce the following array?:
What code would produce the following array?
```
```py
[[1. 1.]
[1. 1.]
[1. 1.]
@ -44,7 +46,6 @@ question:
print(b)
```
solution: 1
```
````
</section>

View File

@ -7,22 +7,29 @@ videoId: 5Nwfs5Ej85Q
---
## Description
<section id='description'>
</section>
## Tests
<section id='tests'>
```yml
question:
text: 'Why are Numpy arrays faster than regular Python lists?:'
text: |
Why are Numpy arrays faster than regular Python lists?
answers:
- Numpy does not perform type checking while iterating through objects.
- Numpy uses fixed types.
- Numpy uses contiguous memory.
- All of the above.
- |
Numpy does not perform type checking while iterating through objects.
- |
Numpy uses fixed types.
- |
Numpy uses contiguous memory.
- |
All of the above.
solution: 4
```
</section>