fix: QA/Infosec update and python to chinese
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
2c78402837
commit
1cfa09adc4
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -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>
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e46f7e5ac417301a38fb929
|
||||
title: Demographic Data Analyzer
|
||||
challengeType: 10
|
||||
isHidden: false
|
||||
isRequired: true
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
In this challenge you must analyze demographic data using Pandas. You are given a dataset of demographic data that was extracted from the 1994 Census database.
|
||||
|
||||
You can access <a href='https://repl.it/@freeCodeCamp/fcc-demographic-data-analyzer' target='_blank'>the full project description and starter code on repl.it</a>.
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
|
||||
We are still developing the interactive instructional part of the data analysis with Python curriculum. For now, you will have to use other resources to learn how to pass this challenge.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'It should pass all Python tests.'
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
|
||||
```py
|
||||
# Python challenges don't need solutions,
|
||||
# because they would need to be tested against a full working project.
|
||||
# Please check our contributing guidelines to learn more.
|
||||
```
|
||||
|
||||
</section>
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e46f7e5ac417301a38fb928
|
||||
title: Mean-Variance-Standard Deviation Calculator
|
||||
challengeType: 10
|
||||
isHidden: false
|
||||
isRequired: true
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
Create a function that uses Numpy to output the mean, variance, and standard deviation of the rows, columns, and elements in a 3 x 3 matrix.
|
||||
|
||||
You can access <a href='https://repl.it/@freeCodeCamp/fcc-mean-var-std' target='_blank'>the full project description and starter code on repl.it</a>.
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
|
||||
We are still developing the interactive instructional part of the data analysis with Python curriculum. For now, you will have to use other resources to learn how to pass this challenge.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'It should pass all Python tests.'
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
|
||||
```py
|
||||
# Python challenges don't need solutions,
|
||||
# because they would need to be tested against a full working project.
|
||||
# Please check our contributing guidelines to learn more.
|
||||
```
|
||||
|
||||
</section>
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e46f7f8ac417301a38fb92a
|
||||
title: Medical Data Visualizer
|
||||
challengeType: 10
|
||||
isHidden: false
|
||||
isRequired: true
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
In this project, you will visualize and make calculations from medical examination data using matplotlib, seaborn, and pandas.
|
||||
|
||||
You can access <a href='https://repl.it/@freeCodeCamp/fcc-medical-data-visualizer' target='_blank'>the full project description and starter code on repl.it</a>.
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
|
||||
We are still developing the interactive instructional part of the data analysis with Python curriculum. For now, you will have to use other resources to learn how to pass this challenge.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'It should pass all Python tests.'
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
|
||||
```py
|
||||
# Python challenges don't need solutions,
|
||||
# because they would need to be tested against a full working project.
|
||||
# Please check our contributing guidelines to learn more.
|
||||
```
|
||||
|
||||
</section>
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e46f802ac417301a38fb92b
|
||||
title: Page View Time Series Visualizer
|
||||
challengeType: 10
|
||||
isHidden: false
|
||||
isRequired: true
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
For this project you will visualize time series data using a line chart, bar chart, and box plots. You will use Pandas, matplotlib, and seaborn to visualize a dataset containing the number of page views each day on the freeCodeCamp.org forum from 2016-05-09 to 2019-12-03. The data visualizations will help you understand the patterns in visits and identify yearly and monthly growth.
|
||||
|
||||
You can access <a href='https://repl.it/@freeCodeCamp/fcc-time-series-visualizer' target='_blank'>the full project description and starter code on repl.it</a>.
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
|
||||
We are still developing the interactive instructional part of the data analysis with Python curriculum. For now, you will have to use other resources to learn how to pass this challenge.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'It should pass all Python tests.'
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
|
||||
```py
|
||||
# Python challenges don't need solutions,
|
||||
# because they would need to be tested against a full working project.
|
||||
# Please check our contributing guidelines to learn more.
|
||||
```
|
||||
|
||||
</section>
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e4f5c4b570f7e3a4949899f
|
||||
title: Sea Level Predictor
|
||||
challengeType: 10
|
||||
isHidden: false
|
||||
isRequired: true
|
||||
---
|
||||
|
||||
## Description
|
||||
<section id='description'>
|
||||
In this project, you will analyze a dataset of the global average sea level change since 1880. You will use the data to predict the sea level change through year 2050.
|
||||
|
||||
You can access <a href='https://repl.it/@freeCodeCamp/fcc-sea-level-predictor' target='_blank'>the full project description and starter code on repl.it</a>.
|
||||
|
||||
After going to that link, fork the project. Once you complete the project based on the instructions in 'README.md', submit your project link below.
|
||||
|
||||
We are still developing the interactive instructional part of the data analysis with Python curriculum. For now, you will have to use other resources to learn how to pass this challenge.
|
||||
</section>
|
||||
|
||||
## Instructions
|
||||
<section id='instructions'>
|
||||
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
tests:
|
||||
- text: 'It should pass all Python tests.'
|
||||
testString: ''
|
||||
|
||||
```
|
||||
|
||||
</section>
|
||||
|
||||
## Challenge Seed
|
||||
<section id='challengeSeed'>
|
||||
|
||||
</section>
|
||||
|
||||
## Solution
|
||||
<section id='solution'>
|
||||
|
||||
```py
|
||||
# Python challenges don't need solutions,
|
||||
# because they would need to be tested against a full working project.
|
||||
# Please check our contributing guidelines to learn more.
|
||||
```
|
||||
|
||||
</section>
|
@ -0,0 +1,50 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed4
|
||||
title: Accessing and Changing Elements, Rows, Columns
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: v-7Y7koJ_N0
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
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]])
|
||||
|
||||
# Output:
|
||||
# [[ 1 2 20 4 5]
|
||||
# [ 6 7 20 9 10]]
|
||||
```
|
||||
answers:
|
||||
- |
|
||||
```python
|
||||
a[:, 3] = 20
|
||||
```
|
||||
- |
|
||||
```python
|
||||
a[2, :] = 20
|
||||
```
|
||||
- |
|
||||
```python
|
||||
a[:, 2] = 20
|
||||
```
|
||||
- |
|
||||
```python
|
||||
a[1, 2] = 20
|
||||
```
|
||||
solution: 3
|
||||
````
|
||||
|
||||
</section>
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed3
|
||||
title: Basics of Numpy
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: f9QrZrKQMLI
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
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:
|
||||
- |
|
||||
```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>
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed7
|
||||
title: Copying Arrays Warning
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: iIoQ0_L0GvA
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What is the value of `a` after running the following code?
|
||||
|
||||
```py
|
||||
import numpy as np
|
||||
|
||||
a = np.array([1, 2, 3, 4, 5])
|
||||
b = a
|
||||
b[2] = 20
|
||||
```
|
||||
|
||||
answers:
|
||||
- |
|
||||
```python
|
||||
[1 2 3 4 5]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[1 2 20 4 5]
|
||||
```
|
||||
- |
|
||||
```python
|
||||
[1 20 3 4 5]
|
||||
```
|
||||
solution: 2
|
||||
````
|
||||
|
||||
</section>
|
@ -0,0 +1,62 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed6
|
||||
title: Initialize Array Problem
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: 0jGfH8BPfOk
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
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.]
|
||||
[1. 0. 0. 0. 1.]
|
||||
[1. 1. 1. 1. 1.]]
|
||||
```
|
||||
|
||||
answers:
|
||||
- |
|
||||
```py
|
||||
output = np.ones((5, 5))
|
||||
|
||||
z = np.zeros((3, 3))
|
||||
z[1, 1] = 9
|
||||
|
||||
output[1:-1, 1:-1] = z
|
||||
```
|
||||
- |
|
||||
```py
|
||||
output = np.ones((5, 5))
|
||||
|
||||
z = np.zeros((3, 3))
|
||||
z[1, 1] = 9
|
||||
|
||||
output[1:3, 1:3] = z
|
||||
```
|
||||
- |
|
||||
```py
|
||||
output = np.ones((5, 5))
|
||||
|
||||
z = np.zeros((3, 3))
|
||||
z[1, 1] = 9
|
||||
|
||||
output[4:1, 4:1] = z
|
||||
```
|
||||
solution: 1
|
||||
````
|
||||
|
||||
</section>
|
@ -0,0 +1,46 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed5
|
||||
title: Initializing Different Arrays
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: CEykdsKT4U4
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What will the following code print?
|
||||
|
||||
```py
|
||||
a = np.array([[1, 2, 3, 4, 5], [6, 7, 8, 9, 10]])
|
||||
|
||||
print(np.full_like(a, 100))
|
||||
```
|
||||
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>
|
@ -0,0 +1,59 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600eda
|
||||
title: Loading Data and Advanced Indexing
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: tUdBZ7pF8Jg
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
Given a file named `data.txt` with these contents:
|
||||
|
||||
```
|
||||
29,97,32,100,45
|
||||
15,88,5,75,22
|
||||
```
|
||||
|
||||
What code would produce the following array?
|
||||
|
||||
```py
|
||||
[29. 32. 45. 15. 5. 22.]
|
||||
```
|
||||
|
||||
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>
|
@ -0,0 +1,50 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed8
|
||||
title: Mathematics
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: 7txegvyhtVk
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What is the value of `b` after running the following code?
|
||||
|
||||
```py
|
||||
import numpy as np
|
||||
|
||||
a = np.array(([1, 2, 3, 4, 5], [6, 7, 8, 9, 10]))
|
||||
b = np.max(a, axis=1).sum()
|
||||
```
|
||||
|
||||
answers:
|
||||
- |
|
||||
```py
|
||||
10
|
||||
```
|
||||
- |
|
||||
```py
|
||||
7
|
||||
```
|
||||
- |
|
||||
```py
|
||||
5
|
||||
```
|
||||
- |
|
||||
```py
|
||||
15
|
||||
```
|
||||
solution: 4
|
||||
````
|
||||
|
||||
</section>
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed9
|
||||
title: Reorganizing Arrays
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: VNWAQbEM-C8
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
````yml
|
||||
question:
|
||||
text: |
|
||||
What code would produce the following array?
|
||||
|
||||
```py
|
||||
[[1. 1.]
|
||||
[1. 1.]
|
||||
[1. 1.]
|
||||
[1. 1.]]
|
||||
```
|
||||
answers:
|
||||
- |
|
||||
```py
|
||||
a = np.ones((2, 4))
|
||||
b = a.reshape((4, 2))
|
||||
print(b)
|
||||
```
|
||||
- |
|
||||
```py
|
||||
a = np.ones((2, 4))
|
||||
b = a.reshape((2, 4))
|
||||
print(b)
|
||||
```
|
||||
- |
|
||||
```py
|
||||
a = np.ones((2, 4))
|
||||
b = a.reshape((8, 1))
|
||||
print(b)
|
||||
```
|
||||
solution: 1
|
||||
````
|
||||
|
||||
</section>
|
@ -0,0 +1,35 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed2
|
||||
title: What is NumPy
|
||||
challengeType: 11
|
||||
isHidden: false
|
||||
videoId: 5Nwfs5Ej85Q
|
||||
---
|
||||
|
||||
## Description
|
||||
|
||||
<section id='description'>
|
||||
</section>
|
||||
|
||||
## Tests
|
||||
|
||||
<section id='tests'>
|
||||
|
||||
```yml
|
||||
question:
|
||||
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.
|
||||
solution: 4
|
||||
```
|
||||
|
||||
</section>
|
Reference in New Issue
Block a user