Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
This commit is contained in:
committed by
GitHub
parent
a07f84c8ec
commit
0bd52f8bd1
@ -5,37 +5,38 @@ challengeType: 11
|
||||
videoId: nVAaxZ34khk
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What does the shape of our dataframe tell us?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
What does the shape of our dataframe tell us?
|
||||
## --answers--
|
||||
|
||||
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.
|
||||
solution: 2
|
||||
```
|
||||
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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,35 +5,34 @@ challengeType: 11
|
||||
videoId: 0kJz0q0pvgQ
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What does the `loc` method allow you to do?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
What does the <code>loc</code> method allow you to do?
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
Retrieve a subset of rows and columns by supplying integer-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
|
||||
```
|
||||
Retrieve a subset of rows and columns by supplying integer-location arguments.
|
||||
|
||||
---
|
||||
|
||||
Access a group of rows and columns by supplying label(s) arguments.
|
||||
|
||||
---
|
||||
|
||||
Returns the first `n` rows based on the integer argument supplied.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,38 +5,38 @@ challengeType: 11
|
||||
videoId: mHjxzFS5_Z0
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
When using Matplotlib's global API, what does the order of numbers mean here?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
When using Matplotlib's global API, what does the order of numbers mean here?
|
||||
```py
|
||||
plt.subplot(1, 2, 1)
|
||||
```
|
||||
```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.
|
||||
solution: 3
|
||||
````
|
||||
## --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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,35 +5,34 @@ challengeType: 11
|
||||
videoId: kj7QqjXhH6A
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
The Python method `.duplicated()` returns a boolean Series for your DataFrame. `True` is the return value for rows that:
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
The Python method `.duplicated()` returns a boolean Series for your DataFrame. `True` is the return value for rows that:
|
||||
## --answers--
|
||||
|
||||
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.
|
||||
solution: 2
|
||||
```
|
||||
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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,58 +5,57 @@ challengeType: 11
|
||||
videoId: ovYNhnltVxY
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
```py
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
s = pd.Series(['a', 3, np.nan, 1, np.nan])
|
||||
|
||||
s = pd.Series(['a', 3, np.nan, 1, np.nan])
|
||||
print(s.notnull().sum())
|
||||
```
|
||||
|
||||
print(s.notnull().sum())
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
3
|
||||
- |
|
||||
```
|
||||
0 True
|
||||
1 True
|
||||
2 False
|
||||
3 True
|
||||
4 False
|
||||
dtype: bool
|
||||
```
|
||||
- |
|
||||
```
|
||||
0 False
|
||||
1 False
|
||||
2 True
|
||||
3 False
|
||||
4 True
|
||||
dtype: bool
|
||||
```
|
||||
solution: 1
|
||||
````
|
||||
3
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
0 True
|
||||
1 True
|
||||
2 False
|
||||
3 True
|
||||
4 False
|
||||
dtype: bool
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
0 False
|
||||
1 False
|
||||
2 True
|
||||
3 False
|
||||
4 True
|
||||
dtype: bool
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
||||
</section>
|
||||
|
@ -5,66 +5,65 @@ challengeType: 11
|
||||
videoId: sTMN_pdI6S0
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
|
||||
```py
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
s = pd.Series([np.nan, 1, 2, np.nan, 3])
|
||||
s = s.fillna(method='ffill')
|
||||
|
||||
s = pd.Series([np.nan, 1, 2, np.nan, 3])
|
||||
s = s.fillna(method='ffill')
|
||||
print(s)
|
||||
```
|
||||
|
||||
print(s)
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```
|
||||
0 1.0
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 3.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
- |
|
||||
```
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 2.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
- |
|
||||
```
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 NaN
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
solution: 2
|
||||
````
|
||||
```
|
||||
0 1.0
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 3.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 2.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 NaN
|
||||
4 3.0
|
||||
dtype: float64
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,36 +5,35 @@ challengeType: 11
|
||||
videoId: h8caJq2Bb9w
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- <a href="https://twitter.com/rmotr_com/status/1122176794696847361" target="_blank" rel="noopener noreferrer">Twitter Cheat Sheet</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
- [Twitter Cheat Sheet](https://twitter.com/rmotr_com/status/1122176794696847361)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What is **not** allowed in a Jupyter Notebook's cell?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
What is **not** allowed in a Jupyter Notebook's cell?
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
Markdown
|
||||
- |
|
||||
Python code
|
||||
- |
|
||||
An Excel sheet
|
||||
solution: 3
|
||||
```
|
||||
Markdown
|
||||
|
||||
---
|
||||
|
||||
Python code
|
||||
|
||||
---
|
||||
|
||||
An Excel sheet
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,32 +5,35 @@ challengeType: 11
|
||||
videoId: VJrP2FUzKP0
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
More resources:
|
||||
- <a href="https://docs.google.com/presentation/d/1fDpjlyMiOMJyuc7_jMekcYLPP2XlSl1eWw9F7yE7byk" target="_blank" rel="noopener noreferrer">Slides</a>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
\- [Slides](https://docs.google.com/presentation/d/1fDpjlyMiOMJyuc7_jMekcYLPP2XlSl1eWw9F7yE7byk)
|
||||
|
||||
<section id='tests'>
|
||||
# --question--
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
Why should you choose R over Python for data analysis?
|
||||
## --text--
|
||||
|
||||
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.
|
||||
solution: 2
|
||||
```
|
||||
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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,36 +5,35 @@ challengeType: 11
|
||||
videoId: 5PPegAs9aLA
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- <a href="https://twitter.com/rmotr_com/status/1122176794696847361" target="_blank" rel="noopener noreferrer">Twitter Cheat Sheet</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
- [Twitter Cheat Sheet](https://twitter.com/rmotr_com/status/1122176794696847361)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
Which cells are responsible for rich display?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
Which cells are responsible for rich display?
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
Code Cells
|
||||
- |
|
||||
Markdown Cells
|
||||
- |
|
||||
Raw Cells
|
||||
solution: 1
|
||||
```
|
||||
Code Cells
|
||||
|
||||
---
|
||||
|
||||
Markdown Cells
|
||||
|
||||
---
|
||||
|
||||
Raw Cells
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
||||
</section>
|
||||
|
@ -5,40 +5,43 @@ challengeType: 11
|
||||
videoId: k1msxD3JIxE
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- <a href="https://twitter.com/rmotr_com/status/1122176794696847361" target="_blank" rel="noopener noreferrer">Twitter Cheat Sheet</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
- [Twitter Cheat Sheet](https://twitter.com/rmotr_com/status/1122176794696847361)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What kind of data can you import and work with in a Jupyter Notebook?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
What kind of data can you import and work with in a Jupyter Notebook?
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
Excel files.
|
||||
- |
|
||||
CSV files.
|
||||
- |
|
||||
XML files.
|
||||
- |
|
||||
Data from an API.
|
||||
- |
|
||||
All of the above.
|
||||
solution: 5
|
||||
```
|
||||
Excel files.
|
||||
|
||||
---
|
||||
|
||||
CSV files.
|
||||
|
||||
---
|
||||
|
||||
XML files.
|
||||
|
||||
---
|
||||
|
||||
Data from an API.
|
||||
|
||||
---
|
||||
|
||||
All of the above.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
5
|
||||
|
||||
</section>
|
||||
|
@ -5,37 +5,38 @@ challengeType: 11
|
||||
videoId: XAT97YLOKD8
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
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?
|
||||
|
||||
```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?
|
||||
## --answers--
|
||||
|
||||
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.
|
||||
solution: 4
|
||||
```
|
||||
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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
||||
</section>
|
||||
|
@ -5,55 +5,54 @@ challengeType: 11
|
||||
videoId: VDYVFHBL1AM
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
A = np.array([
|
||||
['a', 'b', 'c'],
|
||||
['d', 'e', 'f'],
|
||||
['g', 'h', 'i']
|
||||
])
|
||||
|
||||
```py
|
||||
A = np.array([
|
||||
['a', 'b', 'c'],
|
||||
['d', 'e', 'f'],
|
||||
['g', 'h', 'i']
|
||||
])
|
||||
print(A[:, :2])
|
||||
```
|
||||
|
||||
print(A[:, :2])
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```python
|
||||
[['a' 'b']]
|
||||
```
|
||||
- |
|
||||
```py
|
||||
[['b' 'c']
|
||||
['e' 'f']
|
||||
['h' 'i']]
|
||||
```
|
||||
- |
|
||||
```py
|
||||
[['a' 'b']
|
||||
['d' 'e']
|
||||
['g' 'h']]
|
||||
```
|
||||
solution: 3
|
||||
````
|
||||
```python
|
||||
[['a' 'b']]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
[['b' 'c']
|
||||
['e' 'f']
|
||||
['h' 'i']]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
[['a' 'b']
|
||||
['d' 'e']
|
||||
['g' 'h']]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,50 +5,52 @@ challengeType: 11
|
||||
videoId: N1ttsMmcVMM
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
a = np.arange(5)
|
||||
|
||||
```py
|
||||
a = np.arange(5)
|
||||
print(a <= 3)
|
||||
```
|
||||
|
||||
print(a <= 3)
|
||||
```
|
||||
answers:
|
||||
- |
|
||||
```python
|
||||
[False, False, False, False, True]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[5]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[0, 1, 2, 3]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[True, True, True, True, False]
|
||||
```
|
||||
solution: 4
|
||||
````
|
||||
## --answers--
|
||||
|
||||
```python
|
||||
[False, False, False, False, True]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```python
|
||||
[5]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```python
|
||||
[0, 1, 2, 3]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```python
|
||||
[True, True, True, True, False]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
||||
</section>
|
||||
|
@ -5,35 +5,34 @@ challengeType: 11
|
||||
videoId: P-JjV6GBCmk
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
Why is Numpy an important, but unpopular Python library?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
Why is Numpy an important, but unpopular Python library?
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
Often you won't work directly with Numpy.
|
||||
- |
|
||||
It is extremely slow.
|
||||
- |
|
||||
Working with Numpy is difficult.
|
||||
solution: 1
|
||||
```
|
||||
Often you won't work directly with Numpy.
|
||||
|
||||
---
|
||||
|
||||
It is extremely slow.
|
||||
|
||||
---
|
||||
|
||||
Working with Numpy is difficult.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
||||
</section>
|
||||
|
@ -5,36 +5,38 @@ challengeType: 11
|
||||
videoId: YIqgrNLAZkA
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
About how much memory does the integer `5` consume in plain Python?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
About how much memory does the integer `5` consume in plain Python?
|
||||
answers:
|
||||
- |
|
||||
32 bits
|
||||
- |
|
||||
20 bytes
|
||||
- |
|
||||
16 bytes
|
||||
- |
|
||||
8 bits
|
||||
solution: 2
|
||||
```
|
||||
## --answers--
|
||||
|
||||
32 bits
|
||||
|
||||
---
|
||||
|
||||
20 bytes
|
||||
|
||||
---
|
||||
|
||||
16 bytes
|
||||
|
||||
---
|
||||
|
||||
8 bits
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,46 +5,45 @@ challengeType: 11
|
||||
videoId: eqSVcJbaPdk
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What is the value of `a` after you run the following code?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What is the value of `a` after you run the following code?
|
||||
```py
|
||||
a = np.arange(5)
|
||||
a + 20
|
||||
```
|
||||
|
||||
```py
|
||||
a = np.arange(5)
|
||||
a + 20
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```python
|
||||
[20, 21, 22, 24, 24]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[0, 1, 2, 3, 4]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[25, 26, 27, 28, 29]
|
||||
```
|
||||
solution: 2
|
||||
````
|
||||
```python
|
||||
[20, 21, 22, 24, 24]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```python
|
||||
[0, 1, 2, 3, 4]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```python
|
||||
[25, 26, 27, 28, 29]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,69 +5,68 @@ challengeType: 11
|
||||
videoId: BFlH0fN5xRQ
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
import pandas as pd
|
||||
|
||||
```py
|
||||
import pandas as pd
|
||||
certificates_earned = pd.DataFrame({
|
||||
'Certificates': [8, 2, 5, 6],
|
||||
'Time (in months)': [16, 5, 9, 12]
|
||||
})
|
||||
names = ['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
|
||||
certificates_earned = pd.DataFrame({
|
||||
'Certificates': [8, 2, 5, 6],
|
||||
'Time (in months)': [16, 5, 9, 12]
|
||||
})
|
||||
names = ['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
certificates_earned.index = names
|
||||
longest_streak = pd.Series([13, 11, 9, 7], index=names)
|
||||
certificates_earned['Longest streak'] = longest_streak
|
||||
|
||||
certificates_earned.index = names
|
||||
longest_streak = pd.Series([13, 11, 9, 7], index=names)
|
||||
certificates_earned['Longest streak'] = longest_streak
|
||||
print(certificates_earned)
|
||||
```
|
||||
|
||||
print(certificates_earned)
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```
|
||||
Tom 13
|
||||
Kris 11
|
||||
Ahmad 9
|
||||
Beau 7
|
||||
Name: Longest streak, dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Certificates Time (in months) Longest streak
|
||||
Tom 8 16 13
|
||||
Kris 2 5 11
|
||||
Ahmad 5 9 9
|
||||
Beau 6 12 7
|
||||
```
|
||||
- |
|
||||
```
|
||||
Certificates Longest streak
|
||||
Tom 8 13
|
||||
Kris 2 11
|
||||
Ahmad 5 9
|
||||
Beau 6 7
|
||||
```
|
||||
solution: 2
|
||||
````
|
||||
```
|
||||
Tom 13
|
||||
Kris 11
|
||||
Ahmad 9
|
||||
Beau 7
|
||||
Name: Longest streak, dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Certificates Time (in months) Longest streak
|
||||
Tom 8 16 13
|
||||
Kris 2 5 11
|
||||
Ahmad 5 9 9
|
||||
Beau 6 12 7
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Certificates Longest streak
|
||||
Tom 8 13
|
||||
Kris 2 11
|
||||
Ahmad 5 9
|
||||
Beau 6 7
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,56 +5,55 @@ challengeType: 11
|
||||
videoId: _sSo2XZoB3E
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What code would add a "Certificates per month" column to the `certificates_earned` DataFrame like the one below?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
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
|
||||
Tom 8 16 0.50
|
||||
Kris 2 5 0.40
|
||||
Ahmad 5 9 0.56
|
||||
Beau 6 12 0.50
|
||||
```
|
||||
|
||||
```
|
||||
Certificates Time (in months) Certificates per month
|
||||
Tom 8 16 0.50
|
||||
Kris 2 5 0.40
|
||||
Ahmad 5 9 0.56
|
||||
Beau 6 12 0.50
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```py
|
||||
certificates_earned['Certificates'] /
|
||||
certificates_earned['Time (in months)']
|
||||
```
|
||||
- |
|
||||
```py
|
||||
certificates_earned['Certificates per month'] = round(
|
||||
certificates_earned['Certificates'] /
|
||||
certificates_earned['Time (in months)']
|
||||
)
|
||||
```
|
||||
- |
|
||||
```py
|
||||
certificates_earned['Certificates per month'] = round(
|
||||
certificates_earned['Certificates'] /
|
||||
certificates_earned['Time (in months)'], 2
|
||||
)
|
||||
```
|
||||
solution: 3
|
||||
````
|
||||
```py
|
||||
certificates_earned['Certificates'] /
|
||||
certificates_earned['Time (in months)']
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
certificates_earned['Certificates per month'] = round(
|
||||
certificates_earned['Certificates'] /
|
||||
certificates_earned['Time (in months)']
|
||||
)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
certificates_earned['Certificates per month'] = round(
|
||||
certificates_earned['Certificates'] /
|
||||
certificates_earned['Time (in months)'], 2
|
||||
)
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,62 +5,61 @@ challengeType: 11
|
||||
videoId: 7SgFBYXaiH0
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
import pandas as pd
|
||||
|
||||
```py
|
||||
import pandas as pd
|
||||
certificates_earned = pd.DataFrame({
|
||||
'Certificates': [8, 2, 5, 6],
|
||||
'Time (in months)': [16, 5, 9, 12]
|
||||
})
|
||||
|
||||
certificates_earned = pd.DataFrame({
|
||||
'Certificates': [8, 2, 5, 6],
|
||||
'Time (in months)': [16, 5, 9, 12]
|
||||
})
|
||||
certificates_earned.index = ['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
|
||||
certificates_earned.index = ['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
print(certificates_earned.iloc[2])
|
||||
```
|
||||
|
||||
print(certificates_earned.iloc[2])
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```
|
||||
Tom 16
|
||||
Kris 5
|
||||
Ahmad 9
|
||||
Beau 12
|
||||
Name: Time (in months), dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Certificates 6
|
||||
Time (in months) 12
|
||||
Name: Beau, dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Certificates 5
|
||||
Time (in months) 9
|
||||
Name: Ahmad, dtype: int64
|
||||
```
|
||||
solution: 3
|
||||
````
|
||||
```
|
||||
Tom 16
|
||||
Kris 5
|
||||
Ahmad 9
|
||||
Beau 12
|
||||
Name: Time (in months), dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Certificates 6
|
||||
Time (in months) 12
|
||||
Name: Beau, dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Certificates 5
|
||||
Time (in months) 9
|
||||
Name: Ahmad, dtype: int64
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -2,64 +2,63 @@
|
||||
id: 5e9a093a74c4063ca6f7c159
|
||||
title: Pandas Indexing and Conditional Selection
|
||||
challengeType: 11
|
||||
videoId: -ZOrgV_aA9A
|
||||
videoId: '-ZOrgV_aA9A'
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
import pandas as pd
|
||||
|
||||
```py
|
||||
import pandas as pd
|
||||
certificates_earned = pd.Series(
|
||||
[8, 2, 5, 6],
|
||||
index=['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
)
|
||||
|
||||
certificates_earned = pd.Series(
|
||||
[8, 2, 5, 6],
|
||||
index=['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
)
|
||||
print(certificates_earned[certificates_earned > 5])
|
||||
```
|
||||
|
||||
print(certificates_earned[certificates_earned > 5])
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```
|
||||
Tom True
|
||||
Kris False
|
||||
Ahmad False
|
||||
Beau True
|
||||
dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Tom 8
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Tom 8
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
solution: 3
|
||||
````
|
||||
```
|
||||
Tom True
|
||||
Kris False
|
||||
Ahmad False
|
||||
Beau True
|
||||
dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Tom 8
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Tom 8
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,64 +5,63 @@ challengeType: 11
|
||||
videoId: 0xACW-8cZU0
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What will the following code print out?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print out?
|
||||
```py
|
||||
import pandas as pd
|
||||
|
||||
```py
|
||||
import pandas as pd
|
||||
certificates_earned = pd.Series(
|
||||
[8, 2, 5, 6],
|
||||
index=['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
)
|
||||
|
||||
certificates_earned = pd.Series(
|
||||
[8, 2, 5, 6],
|
||||
index=['Tom', 'Kris', 'Ahmad', 'Beau']
|
||||
)
|
||||
print(certificates_earned)
|
||||
```
|
||||
|
||||
print(certificates_earned)
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
```
|
||||
Tom 8
|
||||
Kris 2
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Kris 2
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
Tom 8
|
||||
dtype: int64
|
||||
```
|
||||
- |
|
||||
```
|
||||
Tom 8
|
||||
Kris 2
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
Name: certificates_earned dtype: int64
|
||||
```
|
||||
solution: 1
|
||||
````
|
||||
```
|
||||
Tom 8
|
||||
Kris 2
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Kris 2
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
Tom 8
|
||||
dtype: int64
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
Tom 8
|
||||
Kris 2
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
Name: certificates_earned dtype: int64
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
||||
</section>
|
||||
|
@ -5,36 +5,38 @@ challengeType: 11
|
||||
videoId: bJaqnTWQmb0
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What Python library has the `.read_html()` method we can we use for parsing HTML documents and extracting tables?
|
||||
|
||||
```yml
|
||||
question:
|
||||
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
|
||||
solution: 4
|
||||
```
|
||||
## --answers--
|
||||
|
||||
BeautifierSoupy
|
||||
|
||||
---
|
||||
|
||||
WebReader
|
||||
|
||||
---
|
||||
|
||||
HTTP-master
|
||||
|
||||
---
|
||||
|
||||
Pandas
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
||||
</section>
|
||||
|
@ -5,34 +5,34 @@ challengeType: 11
|
||||
videoId: NzpU17ZVlUw
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What is the main difference between lists and tuples in Python?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
What is the main difference between lists and tuples in Python?
|
||||
answers:
|
||||
- |
|
||||
Tuples are immutable.
|
||||
- |
|
||||
Lists are ordered.
|
||||
- |
|
||||
Tuples are unordered.
|
||||
solution: 1
|
||||
```
|
||||
## --answers--
|
||||
|
||||
Tuples are immutable.
|
||||
|
||||
---
|
||||
|
||||
Lists are ordered.
|
||||
|
||||
---
|
||||
|
||||
Tuples are unordered.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
||||
</section>
|
||||
|
@ -5,36 +5,38 @@ challengeType: 11
|
||||
videoId: PrQV9JkLhb4
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
How do we define blocks of code in the body of functions in Python?
|
||||
|
||||
```yml
|
||||
question:
|
||||
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.
|
||||
solution: 2
|
||||
```
|
||||
## --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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,49 +5,51 @@ challengeType: 11
|
||||
videoId: XzosGWLafrY
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
How would you iterate over and print the keys and values of a dictionary named `user`?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
How would you iterate over and print the keys and values of a dictionary named `user`?
|
||||
answers:
|
||||
- |
|
||||
```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
|
||||
````
|
||||
## --answers--
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,48 +5,50 @@ challengeType: 11
|
||||
videoId: ViGEv0zOzUk
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
How would you import the CSV file `data.csv` and store it in a DataFrame using the Pandas module?
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
How would you import the CSV file `data.csv` and store it in a DataFrame using the Pandas module?
|
||||
answers:
|
||||
- |
|
||||
```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
|
||||
````
|
||||
## --answers--
|
||||
|
||||
```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")
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
@ -5,34 +5,34 @@ challengeType: 11
|
||||
videoId: MtgXS1MofRw
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
What method does a `Cursor` instance have and what does it allow?
|
||||
|
||||
```yml
|
||||
question:
|
||||
text: |
|
||||
What method does a `Cursor` instance have and what does it allow?
|
||||
answers:
|
||||
- |
|
||||
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
|
||||
```
|
||||
## --answers--
|
||||
|
||||
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.
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
||||
</section>
|
||||
|
@ -5,68 +5,67 @@ challengeType: 11
|
||||
videoId: cDnt02BcHng
|
||||
---
|
||||
|
||||
## Description
|
||||
# --description--
|
||||
|
||||
<section id='description'>
|
||||
<em>Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.</em>
|
||||
*Instead of using notebooks.ai like it shows in the video, you can use Google Colab instead.*
|
||||
|
||||
More resources:
|
||||
|
||||
- <a href="https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas" target="_blank" rel="noopener noreferrer">Notebooks on GitHub</a>
|
||||
- <a href="https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb" target="_blank" rel="noopener noreferrer">How to open Notebooks from GitHub using Google Colab.</a>
|
||||
- [Notebooks on GitHub](https://github.com/ine-rmotr-curriculum/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [How to open Notebooks from GitHub using Google Colab.](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
</section>
|
||||
# --question--
|
||||
|
||||
## Tests
|
||||
## --text--
|
||||
|
||||
<section id='tests'>
|
||||
Given a file named `certificates.csv` with these contents:
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
Given a file named `certificates.csv` with these contents:
|
||||
```
|
||||
Name$Certificates$Time (in months)
|
||||
Tom$8$16
|
||||
Kris$2$5
|
||||
Ahmad$5$9
|
||||
Beau$6$12
|
||||
```
|
||||
|
||||
```
|
||||
Name$Certificates$Time (in months)
|
||||
Tom$8$16
|
||||
Kris$2$5
|
||||
Ahmad$5$9
|
||||
Beau$6$12
|
||||
```
|
||||
Fill in the blanks for the missing arguments below:
|
||||
|
||||
Fill in the blanks for the missing arguments below:
|
||||
```py
|
||||
import csv
|
||||
|
||||
```py
|
||||
import csv
|
||||
with open(__A__, 'r') as fp:
|
||||
reader = csv.reader(fp, delimiter=__B__)
|
||||
next(reader)
|
||||
for index, values in enumerate(reader):
|
||||
name, certs_num, months_num = values
|
||||
print(f"{name} earned {__C__} certificates in {months_num} months")
|
||||
```
|
||||
|
||||
with open(__A__, 'r') as fp:
|
||||
reader = csv.reader(fp, delimiter=__B__)
|
||||
next(reader)
|
||||
for index, values in enumerate(reader):
|
||||
name, certs_num, months_num = values
|
||||
print(f"{name} earned {__C__} certificates in {months_num} months")
|
||||
```
|
||||
## --answers--
|
||||
|
||||
answers:
|
||||
- |
|
||||
A: `'certificates.csv'`
|
||||
A: `'certificates.csv'`
|
||||
|
||||
B: `'-'`
|
||||
B: `'-'`
|
||||
|
||||
C: `values`
|
||||
- |
|
||||
A: `'certificates.csv'`
|
||||
C: `values`
|
||||
|
||||
B: `'$'`
|
||||
---
|
||||
|
||||
C: `certs_num`
|
||||
- |
|
||||
A: `'certificates'`
|
||||
A: `'certificates.csv'`
|
||||
|
||||
B: `'$'`
|
||||
B: `'$'`
|
||||
|
||||
C: `certs_num`
|
||||
solution: 2
|
||||
````
|
||||
C: `certs_num`
|
||||
|
||||
---
|
||||
|
||||
A: `'certificates'`
|
||||
|
||||
B: `'$'`
|
||||
|
||||
C: `certs_num`
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
||||
</section>
|
||||
|
Reference in New Issue
Block a user