fix: QA/Infosec update and python to chinese

This commit is contained in:
Oliver Eyton-Williams
2020-08-13 12:00:20 +02:00
committed by Mrugesh Mohapatra
parent 2c78402837
commit 1cfa09adc4
861 changed files with 6847 additions and 0 deletions

View File

@ -0,0 +1,37 @@
---
id: 5e9a093a74c4063ca6f7c14d
title: Data Analysis Example A
challengeType: 11
isHidden: false
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?
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
```
</section>

View File

@ -0,0 +1,35 @@
---
id: 5e9a093a74c4063ca6f7c14e
title: Data Analysis Example B
challengeType: 11
isHidden: false
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?
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.
solution: 2
```
</section>

View File

@ -0,0 +1,38 @@
---
id: 5e9a093a74c4063ca6f7c160
title: Data Cleaning and Visualizations
challengeType: 11
isHidden: false
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
question:
text: |
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.
solution: 3
````
</section>

View File

@ -0,0 +1,35 @@
---
id: 5e9a093a74c4063ca6f7c15f
title: Data Cleaning Duplicates
challengeType: 11
isHidden: false
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.
solution: 2
```
</section>

View File

@ -0,0 +1,58 @@
---
id: 5e9a093a74c4063ca6f7c15d
title: Data Cleaning Introduction
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
import pandas as pd
import numpy as np
s = pd.Series(['a', 3, np.nan, 1, np.nan])
print(s.notnull().sum())
```
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
````
</section>

View File

@ -0,0 +1,66 @@
---
id: 5e9a093a74c4063ca6f7c15e
title: Data Cleaning with DataFrames
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
import pandas as pd
import numpy as np
s = pd.Series([np.nan, 1, 2, np.nan, 3])
s = s.fillna(method='ffill')
print(s)
```
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
````
</section>

View File

@ -0,0 +1,36 @@
---
id: 5e9a093a74c4063ca6f7c14f
title: How to use Jupyter Notebooks Intro
challengeType: 11
isHidden: false
videoId: h8caJq2Bb9w
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/interactive-jupyterlab-tutorial-ac5fa63f" target='_blank'>Notebook</a>
- <a href="https://twitter.com/rmotr_com/status/1122176794696847361" target='_blank'>Twitter Cheat Sheet</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: |
What is **not** allowed in a Jupyter Notebook's cell?
answers:
- |
Markdown
- |
Python code
- |
An Excel sheet
solution: 3
```
</section>

View File

@ -0,0 +1,37 @@
---
id: 5e9a093a74c4063ca6f7c14c
title: Introduction to Data Analysis
challengeType: 11
isHidden: false
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?
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
```
</section>

View File

@ -0,0 +1,36 @@
---
id: 5e9a093a74c4063ca6f7c150
title: Jupyter Notebooks Cells
challengeType: 11
isHidden: false
videoId: 5PPegAs9aLA
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/interactive-jupyterlab-tutorial-ac5fa63f" target='_blank'>Notebook</a>
- <a href="https://twitter.com/rmotr_com/status/1122176794696847361" target='_blank'>Twitter Cheat Sheet</a>
</section>
## Tests
<section id='tests'>
```yml
question:
text: |
Which cells are responsible for rich display?
answers:
- |
Code Cells
- |
Markdown Cells
- |
Raw Cells
solution: 1
```
</section>

View File

@ -0,0 +1,40 @@
---
id: 5e9a093a74c4063ca6f7c151
title: Jupyter Notebooks Importing and Exporting Data
challengeType: 11
isHidden: false
videoId: k1msxD3JIxE
---
## Description
<section id='description'>
More resources:
- <a href="https://notebooks.ai/rmotr-curriculum/interactive-jupyterlab-tutorial-ac5fa63f" target='_blank'>Notebook</a>
- <a href="https://twitter.com/rmotr_com/status/1122176794696847361" target='_blank'>Twitter Cheat Sheet</a>
</section>
## Tests
<section id='tests'>
```yml
question:
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.
solution: 5
```
</section>

View File

@ -0,0 +1,37 @@
---
id: 5e9a093a74c4063ca6f7c157
title: Numpy Algebra and Size
challengeType: 11
isHidden: false
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?
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
```
</section>

View File

@ -0,0 +1,55 @@
---
id: 5e9a093a74c4063ca6f7c154
title: Numpy Arrays
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
A = np.array([
['a', 'b', 'c'],
['d', 'e', 'f'],
['g', 'h', 'i']
])
print(A[:, :2])
```
answers:
- |
```python
[['a' 'b']]
```
- |
```py
[['b' 'c']
['e' 'f']
['h' 'i']]
```
- |
```py
[['a' 'b']
['d' 'e']
['g' 'h']]
```
solution: 3
````
</section>

View File

@ -0,0 +1,50 @@
---
id: 5e9a093a74c4063ca6f7c156
title: Numpy Boolean Arrays
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
a = np.arange(5)
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
````
</section>

View File

@ -0,0 +1,35 @@
---
id: 5e9a093a74c4063ca6f7c152
title: Numpy Introduction A
challengeType: 11
isHidden: false
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?
answers:
- |
Often you won't work directly with Numpy.
- |
It's is extremely slow.
- |
Working with Numpy is difficult.
solution: 1
```
</section>

View File

@ -0,0 +1,36 @@
---
id: 5e9a093a74c4063ca6f7c153
title: Numpy Introduction B
challengeType: 11
isHidden: false
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
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
```
</section>

View File

@ -0,0 +1,46 @@
---
id: 5e9a093a74c4063ca6f7c155
title: Numpy Operations
challengeType: 11
isHidden: false
videoId: eqSVcJbaPdk
---
## 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 value of `a` after you run the following code?
```py
a = np.arange(5)
a + 20
```
answers:
- |
```python
[20, 21, 22, 24, 24]
```
- |
```python
[0, 1, 2, 3, 4]
```
- |
```python
[25, 26, 27, 28, 29]
```
solution: 2
````
</section>

View File

@ -0,0 +1,69 @@
---
id: 5e9a093a74c4063ca6f7c15b
title: Pandas Condtitional Selection and Modifying DataFrames
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```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.index = names
longest_streak = pd.Series([13, 11, 9, 7], index=names)
certificates_earned['Longest streak'] = longest_streak
print(certificates_earned)
```
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
````
</section>

View File

@ -0,0 +1,56 @@
---
id: 5e9a093a74c4063ca6f7c15c
title: Pandas Creating Columns
challengeType: 11
isHidden: false
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
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
```
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
````
</section>

View File

@ -0,0 +1,62 @@
---
id: 5e9a093a74c4063ca6f7c15a
title: Pandas DataFrames
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
import pandas as pd
certificates_earned = pd.DataFrame({
'Certificates': [8, 2, 5, 6],
'Time (in months)': [16, 5, 9, 12]
})
certificates_earned.index = ['Tom', 'Kris', 'Ahmad', 'Beau']
print(certificates_earned.iloc[2])
```
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
````
</section>

View File

@ -0,0 +1,61 @@
---
id: 5e9a093a74c4063ca6f7c159
title: Pandas Indexing and Conditional Selection
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
import pandas as pd
certificates_earned = pd.Series(
[8, 2, 5, 6],
index=['Tom', 'Kris', 'Ahmad', 'Beau']
)
print(certificates_earned[certificates_earned > 5])
```
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
````
</section>

View File

@ -0,0 +1,64 @@
---
id: 5e9a093a74c4063ca6f7c158
title: Pandas Introduction
challengeType: 11
isHidden: false
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
question:
text: |
What will the following code print out?
```py
import pandas as pd
certificates_earned = pd.Series(
[8, 2, 5, 6],
index=['Tom', 'Kris', 'Ahmad', 'Beau']
)
print(certificates_earned)
```
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
````
</section>

View File

@ -0,0 +1,39 @@
---
id: 5e9a093a74c4063ca6f7c164
title: Parsing HTML and Saving Data
challengeType: 11
isHidden: false
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>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-data-from-relational-databases-2a3a889b" target='_blank'>Reading SQL</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-html-tables-eb9cca73" target='_blank'>Reading HTML</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-excel-files-a6b99973" target='_blank'>Reading Excel files</a>
</section>
## Tests
<section id='tests'>
```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
```
</section>

View File

@ -0,0 +1,34 @@
---
id: 5e9a093a74c4063ca6f7c166
title: Python Functions and Collections
challengeType: 11
isHidden: false
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?
answers:
- |
Tuples are immutable.
- |
Lists are ordered.
- |
Tuples are unordered.
solution: 1
```
</section>

View File

@ -0,0 +1,36 @@
---
id: 5e9a093a74c4063ca6f7c165
title: Python Introduction
challengeType: 11
isHidden: false
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?
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
```
</section>

View File

@ -0,0 +1,49 @@
---
id: 5e9a093a74c4063ca6f7c167
title: Python Iteration and Modules
challengeType: 11
isHidden: false
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
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
````
</section>

View File

@ -0,0 +1,51 @@
---
id: 5e9a093a74c4063ca6f7c162
title: Reading Data CSV and TXT
challengeType: 11
isHidden: false
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>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-data-from-relational-databases-2a3a889b" target='_blank'>Reading SQL</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-html-tables-eb9cca73" target='_blank'>Reading HTML</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-excel-files-a6b99973" target='_blank'>Reading Excel files</a>
</section>
## Tests
<section id='tests'>
````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
````
</section>

View File

@ -0,0 +1,37 @@
---
id: 5e9a093a74c4063ca6f7c163
title: Reading Data from Databases
challengeType: 11
isHidden: false
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>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-data-from-relational-databases-2a3a889b" target='_blank'>Reading SQL</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-html-tables-eb9cca73" target='_blank'>Reading HTML</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-excel-files-a6b99973" target='_blank'>Reading Excel files</a>
</section>
## Tests
<section id='tests'>
```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
```
</section>

View File

@ -0,0 +1,71 @@
---
id: 5e9a093a74c4063ca6f7c161
title: Reading Data Introduction
challengeType: 11
isHidden: false
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>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-data-from-relational-databases-2a3a889b" target='_blank'>Reading SQL</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-html-tables-eb9cca73" target='_blank'>Reading HTML</a>
- <a href="https://notebooks.ai/rmotr-curriculum/rdp-reading-excel-files-a6b99973" target='_blank'>Reading Excel files</a>
</section>
## Tests
<section id='tests'>
````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
```
Fill in the blanks for the missing arguments below:
```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")
```
answers:
- |
A: `'certificates.csv'`
B: `'-'`
C: `values`
- |
A: `'certificates.csv'`
B: `'$'`
C: `certs_num`
- |
A: `'certificates'`
B: `'$'`
C: `certs_num`
solution: 2
````
</section>