chore(i18n,learn): processed translations (#44851)
This commit is contained in:
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c14d
|
||||
title: データ分析の例 A
|
||||
challengeType: 11
|
||||
videoId: nVAaxZ34khk
|
||||
bilibiliIds:
|
||||
aid: 590571151
|
||||
bvid: BV1sq4y1f7gr
|
||||
cid: 409002372
|
||||
dashedName: data-analysis-example-a
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
データフレームの形状からわかることは何ですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
メモリに読み込んだデータフレームのギガバイト単位のサイズ。
|
||||
|
||||
---
|
||||
|
||||
データフレームの行と列の数。
|
||||
|
||||
---
|
||||
|
||||
読み込み前のソースデータの行数。
|
||||
|
||||
---
|
||||
|
||||
読み込み前のソースデータの列数。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c14e
|
||||
title: データ分析の例 B
|
||||
challengeType: 11
|
||||
videoId: 0kJz0q0pvgQ
|
||||
bilibiliIds:
|
||||
aid: 505593432
|
||||
bvid: BV1kg411c7M6
|
||||
cid: 409003530
|
||||
dashedName: data-analysis-example-b
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/FreeCodeCamp-Pandas-Real-Life-Example)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
`loc` メソッドでできることは何ですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
整数の位置を示す引数を指定して行と列のサブセットを取得する。
|
||||
|
||||
---
|
||||
|
||||
ラベルの引数を指定して行と列のグループにアクセスする。
|
||||
|
||||
---
|
||||
|
||||
与えられた整数引数に基づいて、最初の `n` 行を返す。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c160
|
||||
title: データクリーニングと可視化
|
||||
challengeType: 11
|
||||
videoId: mHjxzFS5_Z0
|
||||
bilibiliIds:
|
||||
aid: 933107558
|
||||
bvid: BV1KM4y137Ny
|
||||
cid: 409019632
|
||||
dashedName: data-cleaning-and-visualizations
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Matplotlib のグローバル API を使用している場合、次の数字の順序は何を意味しますか?
|
||||
|
||||
```py
|
||||
plt.subplot(1, 2, 1)
|
||||
```
|
||||
|
||||
## --answers--
|
||||
|
||||
図には 1 列、2 行があり、最初の (左の) プロットで図を描き始める。
|
||||
|
||||
---
|
||||
|
||||
最初の (左の) プロットで図を描き始め、図は 2 行、1 列となる。
|
||||
|
||||
---
|
||||
|
||||
図には 1 行、2 列があり、最初の (左の) プロットで図を描き始める。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c15f
|
||||
title: データクリーニングの重複
|
||||
challengeType: 11
|
||||
videoId: kj7QqjXhH6A
|
||||
bilibiliIds:
|
||||
aid: 675611672
|
||||
bvid: BV1VU4y1A7tu
|
||||
cid: 409019368
|
||||
dashedName: data-cleaning-duplicates
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Python のメソッドである `.duplicated()` は、DataFrame の Series をブール値で返します。 戻り値が `True` となる行は次のうちどれですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
重複が含まれていて、行の値にその値の最初の出現が含まれている行。
|
||||
|
||||
---
|
||||
|
||||
重複が含まれていて、行の値がその値の 2 回目以上の出現になっている行。
|
||||
|
||||
---
|
||||
|
||||
重複が含まれていて、行の値に最初または 2 回目の出現が含まれている行。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,62 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c15d
|
||||
title: データクリーニングの概要
|
||||
challengeType: 11
|
||||
videoId: ovYNhnltVxY
|
||||
bilibiliIds:
|
||||
aid: 250574398
|
||||
bvid: BV1Pv411A7GN
|
||||
cid: 409018611
|
||||
dashedName: data-cleaning-introduction
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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
|
||||
|
||||
---
|
||||
|
||||
<pre>0 True
|
||||
1 True
|
||||
2 False
|
||||
3 True
|
||||
4 False
|
||||
dtype: bool</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>0 False
|
||||
1 False
|
||||
2 True
|
||||
3 False
|
||||
4 True
|
||||
dtype: bool</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
@ -0,0 +1,74 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c15e
|
||||
title: DataFrame によるデータクリーニング
|
||||
challengeType: 11
|
||||
videoId: sTMN_pdI6S0
|
||||
bilibiliIds:
|
||||
aid: 505597026
|
||||
bvid: BV1Yg411c7bx
|
||||
cid: 409018948
|
||||
dashedName: data-cleaning-with-dataframes
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/data-cleaning-rmotr-freecodecamp)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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--
|
||||
|
||||
<pre>
|
||||
0 1.0
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 3.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 2.0
|
||||
4 3.0
|
||||
dtype: float64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
0 NaN
|
||||
1 1.0
|
||||
2 2.0
|
||||
3 NaN
|
||||
4 3.0
|
||||
dtype: float64
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c14f
|
||||
title: Jupyter Notebook の使い方紹介
|
||||
challengeType: 11
|
||||
videoId: h8caJq2Bb9w
|
||||
bilibiliIds:
|
||||
aid: 293035919
|
||||
bvid: BV1Hf4y1n7qr
|
||||
cid: 409002965
|
||||
dashedName: how-to-use-jupyter-notebooks-intro
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Jupyter Notebook のセルで**使用できない**ものは何ですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
マークダウン
|
||||
|
||||
---
|
||||
|
||||
Python コード
|
||||
|
||||
---
|
||||
|
||||
Excel シート
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c14c
|
||||
title: データ分析入門
|
||||
challengeType: 11
|
||||
videoId: VJrP2FUzKP0
|
||||
bilibiliIds:
|
||||
aid: 378034466
|
||||
bvid: BV19f4y1c7nu
|
||||
cid: 409001487
|
||||
dashedName: introduction-to-data-analysis
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
その他のリソース:
|
||||
|
||||
\- [スライド](https://docs.google.com/presentation/d/1cUIt8b2ySz-85_ykfeuuWsurccwTAuFPn782pZBzFsU/edit?usp=sharing)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のうち、**データ分析の一部ではない**ことはどれですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
統計モデルとデータ可視化を構築すること。
|
||||
|
||||
---
|
||||
|
||||
分析にとって望ましい結論を選ぶこと。
|
||||
|
||||
---
|
||||
|
||||
不正な値を修正し、無効なデータを削除すること。
|
||||
|
||||
---
|
||||
|
||||
データを適切なデータ構造に変換すること。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
@ -0,0 +1,42 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c150
|
||||
title: Jupyter Notebook のセル
|
||||
challengeType: 11
|
||||
videoId: 5PPegAs9aLA
|
||||
bilibiliIds:
|
||||
aid: 420510493
|
||||
bvid: BV19341117Hq
|
||||
cid: 409003280
|
||||
dashedName: jupyter-notebooks-cells
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Jupyter Notebook のセルの 3 つの主要なタイプは何ですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
コード、マークダウン、Python
|
||||
|
||||
---
|
||||
|
||||
コード、マークダウン、生データ
|
||||
|
||||
---
|
||||
|
||||
マークダウン、Python、生データ
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
@ -0,0 +1,51 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c151
|
||||
title: Jupyter Notebook のデータのインポートとエクスポート
|
||||
challengeType: 11
|
||||
videoId: k1msxD3JIxE
|
||||
bilibiliIds:
|
||||
aid: 975540688
|
||||
bvid: BV1n44y1b7Gi
|
||||
cid: 409006337
|
||||
dashedName: jupyter-notebooks-importing-and-exporting-data
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/ds-content-interactive-jupyterlab-tutorial)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Jupyter Notebook ではどのようなデータをインポートして作業できますか?
|
||||
|
||||
## --answers--
|
||||
|
||||
Excel ファイル
|
||||
|
||||
---
|
||||
|
||||
CSV ファイル
|
||||
|
||||
---
|
||||
|
||||
XML ファイル
|
||||
|
||||
---
|
||||
|
||||
API からのデータ
|
||||
|
||||
---
|
||||
|
||||
上記のすべて
|
||||
|
||||
## --video-solution--
|
||||
|
||||
5
|
||||
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c157
|
||||
title: Numpy の代数とサイズ
|
||||
challengeType: 11
|
||||
videoId: XAT97YLOKD8
|
||||
bilibiliIds:
|
||||
aid: 250621433
|
||||
bvid: BV1hv41137uM
|
||||
cid: 409013128
|
||||
dashedName: numpy-algebra-and-size
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Python の標準ライブラリと Numpy ライブラリとの間で、メモリ内のオブジェクト (リストやデータ型など) のサイズの関係はどうなっていますか? そのことを踏まえるとパフォーマンスにどのような影響が生じますか?
|
||||
|
||||
## --answers--
|
||||
|
||||
標準的な Python オブジェクトは、NumPy オブジェクトよりも多くのメモリを消費する。標準的な Python オブジェクトと NumPy オブジェクトの演算はほぼ同じ時間で実行される。
|
||||
|
||||
---
|
||||
|
||||
NumPy オブジェクトは、標準的な Python オブジェクトよりもはるかに多くのメモリを消費する。NumPy オブジェクトに対する演算は、同等の標準的な Python オブジェクトに対する演算と比べて非常に高速に実行される。
|
||||
|
||||
---
|
||||
|
||||
NumPy オブジェクトは、標準的な Python オブジェクトよりもはるかに少ないメモリしか使用しない。標準的な Python オブジェクトに対する演算は、同等の NumPy オブジェクトに対する演算と比べて非常に高速に実行される。
|
||||
|
||||
---
|
||||
|
||||
標準的な Python オブジェクトは、NumPy オブジェクトよりも多くのメモリを消費する。NumPy オブジェクトに対する演算は、同等の標準的な Python オブジェクトに対する演算と比べて非常に高速に実行される。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
@ -0,0 +1,63 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c154
|
||||
title: Numpy の配列
|
||||
challengeType: 11
|
||||
videoId: VDYVFHBL1AM
|
||||
bilibiliIds:
|
||||
aid: 890607366
|
||||
bvid: BV1zP4y1h7FR
|
||||
cid: 409011400
|
||||
dashedName: numpy-arrays
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```py
|
||||
A = np.array([
|
||||
['a', 'b', 'c'],
|
||||
['d', 'e', 'f'],
|
||||
['g', 'h', 'i']
|
||||
])
|
||||
|
||||
print(A[:, :2])
|
||||
```
|
||||
|
||||
## --answers--
|
||||
|
||||
```py
|
||||
[['a' 'b']]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
[['b' 'c']
|
||||
['e' 'f']
|
||||
['h' 'i']]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
[['a' 'b']
|
||||
['d' 'e']
|
||||
['g' 'h']]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,61 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c156
|
||||
title: Numpy のブール配列
|
||||
challengeType: 11
|
||||
videoId: N1ttsMmcVMM
|
||||
bilibiliIds:
|
||||
aid: 208091324
|
||||
bvid: BV1Qh411p7V8
|
||||
cid: 409012711
|
||||
dashedName: numpy-boolean-arrays
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c152
|
||||
title: Numpy 入門 A
|
||||
challengeType: 11
|
||||
videoId: P-JjV6GBCmk
|
||||
bilibiliIds:
|
||||
aid: 718079611
|
||||
bvid: BV18Q4y1k7om
|
||||
cid: 409007080
|
||||
dashedName: numpy-introduction-a
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
なぜ Numpy は重要でありながら人気のない Python ライブラリなのでしょうか?
|
||||
|
||||
## --answers--
|
||||
|
||||
Numpy で直接作業する機会があまりないから。
|
||||
|
||||
---
|
||||
|
||||
非常に遅いから。
|
||||
|
||||
---
|
||||
|
||||
Numpy で作業することは難しいから。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c153
|
||||
title: Numpy 入門 B
|
||||
challengeType: 11
|
||||
videoId: YIqgrNLAZkA
|
||||
bilibiliIds:
|
||||
aid: 250503382
|
||||
bvid: BV1kv411w7vB
|
||||
cid: 409010193
|
||||
dashedName: numpy-introduction-b
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
通常の Python では、整数 `5` はどれくらいのメモリを消費しますか?
|
||||
|
||||
## --answers--
|
||||
|
||||
32 ビット
|
||||
|
||||
---
|
||||
|
||||
20 バイト
|
||||
|
||||
---
|
||||
|
||||
16 バイト
|
||||
|
||||
---
|
||||
|
||||
8 ビット
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,54 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c155
|
||||
title: Numpy の演算
|
||||
challengeType: 11
|
||||
videoId: eqSVcJbaPdk
|
||||
bilibiliIds:
|
||||
aid: 378057123
|
||||
bvid: BV13f4y1w7od
|
||||
cid: 409012507
|
||||
dashedName: numpy-operations
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-numpy)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードを実行した後、`a` の値は何になりますか?
|
||||
|
||||
```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]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,77 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c15b
|
||||
title: Pandas の条件付き選択とデータフレームの変更
|
||||
challengeType: 11
|
||||
videoId: BFlH0fN5xRQ
|
||||
bilibiliIds:
|
||||
aid: 505598518
|
||||
bvid: BV1vg411c72y
|
||||
cid: 409113534
|
||||
dashedName: pandas-conditional-selection-and-modifying-dataframes
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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--
|
||||
|
||||
<pre>
|
||||
Tom 13
|
||||
Kris 11
|
||||
Ahmad 9
|
||||
Beau 7
|
||||
Name: Longest streak, dtype: int64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
Certificates Time (in months) Longest streak
|
||||
Tom 8 16 13
|
||||
Kris 2 5 11
|
||||
Ahmad 5 9 9
|
||||
Beau 6 12 7
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
Certificates Longest streak
|
||||
Tom 8 13
|
||||
Kris 2 11
|
||||
Ahmad 5 9
|
||||
Beau 6 7
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,62 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c15c
|
||||
title: Pandas での列の作成
|
||||
challengeType: 11
|
||||
videoId: _sSo2XZoB3E
|
||||
bilibiliIds:
|
||||
aid: 975568901
|
||||
bvid: BV1b44y1b7Cg
|
||||
cid: 409018052
|
||||
dashedName: pandas-creating-columns
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のような `certificates_earned` DataFrame に "Certificates per month" (月ごとの証明書) 列を追加するコードはどのようになりますか?
|
||||
|
||||
<pre> 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</pre>
|
||||
|
||||
## --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
|
||||
)
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,70 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c15a
|
||||
title: Pandas のデータフレーム (DataFrame)
|
||||
challengeType: 11
|
||||
videoId: 7SgFBYXaiH0
|
||||
bilibiliIds:
|
||||
aid: 890503235
|
||||
bvid: BV1TP4y1h7qq
|
||||
cid: 409014039
|
||||
dashedName: pandas-dataframes
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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--
|
||||
|
||||
<pre>
|
||||
Tom 16
|
||||
Kris 5
|
||||
Ahmad 9
|
||||
Beau 12
|
||||
Name: Time (in months), dtype: int64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
Certificates 6
|
||||
Time (in months) 12
|
||||
Name: Beau, dtype: int64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
Certificates 5
|
||||
Time (in months) 9
|
||||
Name: Ahmad, dtype: int64
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,69 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c159
|
||||
title: Pandas でのインデックス作成と条件付き選択
|
||||
challengeType: 11
|
||||
videoId: '-ZOrgV_aA9A'
|
||||
bilibiliIds:
|
||||
aid: 720604139
|
||||
bvid: BV1FQ4y1k7tC
|
||||
cid: 409013650
|
||||
dashedName: pandas-indexing-and-conditional-selection
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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--
|
||||
|
||||
<pre>
|
||||
Tom True
|
||||
Kris False
|
||||
Ahmad False
|
||||
Beau True
|
||||
dtype: int64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
Tom 8
|
||||
Ahmad 5
|
||||
Beau 6
|
||||
dtype: int64
|
||||
</pre>
|
||||
|
||||
---
|
||||
|
||||
<pre>
|
||||
Tom 8
|
||||
Beau 6
|
||||
dtype: int64
|
||||
</pre>
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,72 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c158
|
||||
title: Pandas 入門
|
||||
challengeType: 11
|
||||
videoId: 0xACW-8cZU0
|
||||
bilibiliIds:
|
||||
aid: 975510116
|
||||
bvid: BV1u44y1b7fD
|
||||
cid: 409013433
|
||||
dashedName: pandas-introduction
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/freecodecamp-intro-to-pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c164
|
||||
title: HTMLの解析とデータの保存
|
||||
challengeType: 11
|
||||
videoId: bJaqnTWQmb0
|
||||
bilibiliIds:
|
||||
aid: 335522976
|
||||
bvid: BV1RA411F7vi
|
||||
cid: 409023170
|
||||
dashedName: parsing-html-and-saving-data
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/krishnatray/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
HTML ドキュメントの解析やテーブルの抽出に使用できる `.read_html()` メソッドが含まれている Python ライブラリは何ですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
BeautifierSoupy
|
||||
|
||||
---
|
||||
|
||||
WebReader
|
||||
|
||||
---
|
||||
|
||||
HTTP-master
|
||||
|
||||
---
|
||||
|
||||
Pandas
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c166
|
||||
title: Python の関数とコレクション
|
||||
challengeType: 11
|
||||
videoId: NzpU17ZVlUw
|
||||
bilibiliIds:
|
||||
aid: 675544435
|
||||
bvid: BV1pU4y1N7JC
|
||||
cid: 409023833
|
||||
dashedName: python-functions-and-collections
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Python のリストとタプルの主な違いは何ですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
タプルはイミュータブル (変更不可) である。
|
||||
|
||||
---
|
||||
|
||||
リストは順序付けられている。
|
||||
|
||||
---
|
||||
|
||||
タプルは順序付けられていない。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
@ -0,0 +1,47 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c165
|
||||
title: Python 入門
|
||||
challengeType: 11
|
||||
videoId: PrQV9JkLhb4
|
||||
bilibiliIds:
|
||||
aid: 805597530
|
||||
bvid: BV1634y1S7gD
|
||||
cid: 409023550
|
||||
dashedName: python-introduction
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Python の関数の本体でコードブロックを定義するにはどうすればよいですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
新しいコードブロックごとに、それぞれの両端で中括弧を使用する。
|
||||
|
||||
---
|
||||
|
||||
インデントを使用する (通常は右揃えの 4 つのスペース)。
|
||||
|
||||
---
|
||||
|
||||
コードブロックを明記しない。
|
||||
|
||||
---
|
||||
|
||||
中括弧やインデントを使用してコードブロックを明記することができる。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,60 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c167
|
||||
title: Python の繰り返し処理とモジュール
|
||||
challengeType: 11
|
||||
videoId: XzosGWLafrY
|
||||
bilibiliIds:
|
||||
aid: 633068913
|
||||
bvid: BV1db4y127M4
|
||||
cid: 409024056
|
||||
dashedName: python-iteration-and-modules
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/ine-rmotr-curriculum/ds-content-python-under-10-minutes)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
`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)
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,59 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c162
|
||||
title: CSV や TXT のデータの読み取り
|
||||
challengeType: 11
|
||||
videoId: ViGEv0zOzUk
|
||||
bilibiliIds:
|
||||
aid: 505575354
|
||||
bvid: BV1tg411c7GH
|
||||
cid: 409020451
|
||||
dashedName: reading-data-csv-and-txt
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/krishnatray/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Pandas モジュールを使用して CSV ファイル `data.csv` をインポートし、DataFrame に格納するにはどうすればよいですか?
|
||||
|
||||
## --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
|
||||
|
@ -0,0 +1,43 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c163
|
||||
title: データベースからのデータの読み取り
|
||||
challengeType: 11
|
||||
videoId: MtgXS1MofRw
|
||||
bilibiliIds:
|
||||
aid: 890546354
|
||||
bvid: BV1JP4y1h7gk
|
||||
cid: 409020851
|
||||
dashedName: reading-data-from-databases
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/krishnatray/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
`Cursor` インスタンスにはどのようなメソッドがあり、何を実行できますか?
|
||||
|
||||
## --answers--
|
||||
|
||||
`Cursor` インスタンスには、SQL クエリを実行するための `.run()` メソッドがある。
|
||||
|
||||
---
|
||||
|
||||
`Cursor` インスタンスには、レコードを選択するための `.select()` メソッドがある。
|
||||
|
||||
---
|
||||
|
||||
`Cursor` インスタンスには、データベースに対して実行する SQL パラメーターを受け取る `.execute()` メソッドがある。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,76 @@
|
||||
---
|
||||
id: 5e9a093a74c4063ca6f7c161
|
||||
title: データの読み取り入門
|
||||
challengeType: 11
|
||||
videoId: cDnt02BcHng
|
||||
bilibiliIds:
|
||||
aid: 548023524
|
||||
bvid: BV1Nq4y1K7iV
|
||||
cid: 409020187
|
||||
dashedName: reading-data-introduction
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
*動画で説明しているように、notebooks.ai を使用する代わりに Google Colab を使用することができます。*
|
||||
|
||||
その他のリソース:
|
||||
|
||||
- [GitHub のノート](https://github.com/krishnatray/RDP-Reading-Data-with-Python-and-Pandas)
|
||||
- [Google Colab を使用して GitHub からノートを開く方法](https://colab.research.google.com/github/googlecolab/colabtools/blob/master/notebooks/colab-github-demo.ipynb)
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次の内容を含む `certificates.csv` という名前のファイルが与えられます。
|
||||
|
||||
<pre>
|
||||
Name$Certificates$Time (in months)
|
||||
Tom$8$16
|
||||
Kris$2$5
|
||||
Ahmad$5$9
|
||||
Beau$6$12
|
||||
</pre>
|
||||
|
||||
次のコードで、不足している引数部分の空欄を埋めてください。
|
||||
|
||||
```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`
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,78 @@
|
||||
---
|
||||
id: 5e46f7e5ac417301a38fb929
|
||||
title: 人口統計データ分析プログラム
|
||||
challengeType: 10
|
||||
forumTopicId: 462367
|
||||
dashedName: demographic-data-analyzer
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
このプロジェクトは [Replit スターターコード](https://replit.com/github/freeCodeCamp/boilerplate-demographic-data-analyzer)を使用して作業を行います。
|
||||
|
||||
Python カリキュラムの対話式教育コンテンツを引き続き開発中です。 現在、下記の freeCodeCamp.org YouTube チャンネルで、このプロジェクトの完了に必要なすべての知識について説明する動画をいくつか公開しています。
|
||||
|
||||
- [「みんなで Python」ビデオコース](https://www.freecodecamp.org/news/python-for-everybody/) (14 時間)
|
||||
- [「Python を学ぶ」ビデオコース](https://www.freecodecamp.org/news/learn-python-video-course/) (10 時間)
|
||||
|
||||
# --instructions--
|
||||
|
||||
このチャレンジでは、Pandas を使用して人口統計データを分析します。 1994 年の国勢調査データベースから抽出された人口統計データのデータセットが与えられます。 データの例を次に示します。
|
||||
|
||||
```markdown
|
||||
| | age | workclass | fnlwgt | education | education-num | marital-status | occupation | relationship | race | sex | capital-gain | capital-loss | hours-per-week | native-country | salary |
|
||||
|---:|------:|:-----------------|---------:|:------------|----------------:|:-------------------|:------------------|:---------------|:-------|:-------|---------------:|---------------:|-----------------:|:-----------------|:---------|
|
||||
| 0 | 39 | State-gov | 77516 | Bachelors | 13 | Never-married | Adm-clerical | Not-in-family | White | Male | 2174 | 0 | 40 | United-States | <=50K |
|
||||
| 1 | 50 | Self-emp-not-inc | 83311 | Bachelors | 13 | Married-civ-spouse | Exec-managerial | Husband | White | Male | 0 | 0 | 13 | United-States | <=50K |
|
||||
| 2 | 38 | Private | 215646 | HS-grad | 9 | Divorced | Handlers-cleaners | Not-in-family | White | Male | 0 | 0 | 40 | United-States | <=50K |
|
||||
| 3 | 53 | Private | 234721 | 11th | 7 | Married-civ-spouse | Handlers-cleaners | Husband | Black | Male | 0 | 0 | 40 | United-States | <=50K |
|
||||
| 4 | 28 | Private | 338409 | Bachelors | 13 | Married-civ-spouse | Prof-specialty | Wife | Black | Female | 0 | 0 | 40 | Cuba | <=50K |
|
||||
```
|
||||
|
||||
Pandas を使用して次の問いに答える必要があります。
|
||||
|
||||
- このデータセットで表現される各人種の人数は何人ですか? これは、人種名をインデックスラベル (`race` 列) に持つ Pandas のシリーズとして表現する必要があります。
|
||||
- 男性の平均年齢は何歳ですか?
|
||||
- 学士号を取得した人の割合は何パーセントですか?
|
||||
- 高等教育 (`Bachelors` (学士)、`Masters` (修士)、または `Doctorate` (博士)) を受けた人のうち給料が 50K を超えているのは何パーセントですか?
|
||||
- 高等教育を受けていない人のうち給料が 50K を超えているのは何パーセントですか?
|
||||
- 1 週間の最小労働時間は何時間ですか?
|
||||
- 1 週間の最小労働時間だけ働いている人のうち給料が 50K を超えているのは何パーセントですか?
|
||||
- 50K 超を稼いでいる人の割合が最も高い国はどこですか?その割合は何パーセントですか?
|
||||
- インドで 50K 超を稼いでいる人に最も人気のある職業を特定してください。
|
||||
|
||||
ファイル `demographic_data_analyzer` のスターターコードを使用してください。 "None" に設定されているすべての変数が適切な計算またはコードに設定されるように、コードを更新してください。 小数はすべて最も近い小数点以下 1 桁に丸めてください。
|
||||
|
||||
`test_module.py` の下に単体テストが記述してあります。
|
||||
|
||||
## 開発
|
||||
|
||||
開発には `main.py` を使用して関数をテストすることができます。 「実行」ボタンをクリックすると `main.py` が実行されます。
|
||||
|
||||
## テスト
|
||||
|
||||
すでに `test_module.py` から `main.py` にテストをインポートしてあります。 「実行」ボタンを押すと自動的にテストが実行されます。
|
||||
|
||||
## 提出
|
||||
|
||||
プロジェクトの URL をコピーし、freeCodeCamp に提出してください。
|
||||
|
||||
## データセットのソース
|
||||
|
||||
Dua, D. and Graff, C. (2019). [UCI Machine Learning Repository](http://archive.ics.uci.edu/ml). Irvine, CA: University of California, School of Information and Computer Science.
|
||||
|
||||
# --hints--
|
||||
|
||||
すべての Python テストに合格する必要があります。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
```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.
|
||||
```
|
@ -0,0 +1,80 @@
|
||||
---
|
||||
id: 5e46f7e5ac417301a38fb928
|
||||
title: 平均・分散・標準偏差計算プログラム
|
||||
challengeType: 10
|
||||
forumTopicId: 462366
|
||||
dashedName: mean-variance-standard-deviation-calculator
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
このプロジェクトは [Replit スターターコード](https://replit.com/github/freeCodeCamp/boilerplate-mean-variance-standard-deviation-calculator)を使用して作業を行います。
|
||||
|
||||
Python カリキュラムの対話式教育コンテンツを引き続き開発中です。 現在、下記の freeCodeCamp.org YouTube チャンネルで、このプロジェクトの完了に必要なすべての知識について説明する動画をいくつか公開しています。
|
||||
|
||||
- [「みんなで Python」ビデオコース](https://www.freecodecamp.org/news/python-for-everybody/) (14 時間)
|
||||
- [「Python を学ぶ」ビデオコース](https://www.freecodecamp.org/news/learn-python-video-course/) (10 時間)
|
||||
|
||||
# --instructions--
|
||||
|
||||
`mean_var_std.py` に `calculate()` という名前の関数を作成してください。この関数は Numpy を使用して、3 x 3 行列の行、列、要素について平均、分散、標準偏差、最大値、最小値、合計を出力します。
|
||||
|
||||
関数には 9 つの数字からなるリストを入力する必要があります。 関数は、リストを 3 x 3 の Numpy 配列に変換した後、平均、分散、標準偏差、最大値、最小値、合計を含む辞書を返す必要があり、両方の軸と平坦化された行列も返す必要があります。
|
||||
|
||||
返される辞書は次の形式に従う必要があります。
|
||||
|
||||
```py
|
||||
{
|
||||
'mean': [axis1, axis2, flattened],
|
||||
'variance': [axis1, axis2, flattened],
|
||||
'standard deviation': [axis1, axis2, flattened],
|
||||
'max': [axis1, axis2, flattened],
|
||||
'min': [axis1, axis2, flattened],
|
||||
'sum': [axis1, axis2, flattened]
|
||||
}
|
||||
```
|
||||
|
||||
渡されたリストの要素が 9 つに満たない場合、関数は `ValueError` 例外を生成して、"List must contain nine numbers." (リストには 9 つの数値を含めてください。) というメッセージを表示する必要があります。 返される辞書の値は、Numpy 配列ではなくリストである必要があります。
|
||||
|
||||
たとえば、`calculate([0,1,2,3,4,5,6,7,8])` は次を返す必要があります。
|
||||
|
||||
```py
|
||||
{
|
||||
'mean': [[3.0, 4.0, 5.0], [1.0, 4.0, 7.0], 4.0],
|
||||
'variance': [[6.0, 6.0, 6.0], [0.6666666666666666, 0.6666666666666666, 0.6666666666666666], 6.666666666666667],
|
||||
'standard deviation': [[2.449489742783178, 2.449489742783178, 2.449489742783178], [0.816496580927726, 0.816496580927726, 0.816496580927726], 2.581988897471611],
|
||||
'max': [[6, 7, 8], [2, 5, 8], 8],
|
||||
'min': [[0, 1, 2], [0, 3, 6], 0],
|
||||
'sum': [[9, 12, 15], [3, 12, 21], 36]
|
||||
}
|
||||
```
|
||||
|
||||
このプロジェクトの単体テストは `test_module.py` にあります。
|
||||
|
||||
## 開発
|
||||
|
||||
開発には `main.py` を使用して `calculate()` 関数をテストすることができます。 「実行」ボタンをクリックすると `main.py` が実行されます。
|
||||
|
||||
## テスト
|
||||
|
||||
すでに `test_module.py` から `main.py` にテストをインポートしてあります。 「実行」ボタンを押すと自動的にテストが実行されます。
|
||||
|
||||
## 提出
|
||||
|
||||
プロジェクトの URL をコピーし、freeCodeCamp に提出してください。
|
||||
|
||||
# --hints--
|
||||
|
||||
すべての Python テストに合格する必要があります。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
```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.
|
||||
```
|
@ -0,0 +1,90 @@
|
||||
---
|
||||
id: 5e46f7f8ac417301a38fb92a
|
||||
title: 医療データの可視化プログラム
|
||||
challengeType: 10
|
||||
forumTopicId: 462368
|
||||
dashedName: medical-data-visualizer
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
このプロジェクトは [Replit スターターコード](https://replit.com/github/freeCodeCamp/boilerplate-medical-data-visualizer)を使用して作業を行います。
|
||||
|
||||
Python カリキュラムの対話式教育コンテンツを引き続き開発中です。 現在、下記の freeCodeCamp.org YouTube チャンネルで、このプロジェクトの完了に必要なすべての知識について説明する動画をいくつか公開しています。
|
||||
|
||||
- [「みんなで Python」ビデオコース](https://www.freecodecamp.org/news/python-for-everybody/) (14 時間)
|
||||
- [「Python を学ぶ」ビデオコース](https://www.freecodecamp.org/news/learn-python-video-course/) (10 時間)
|
||||
|
||||
# --instructions--
|
||||
|
||||
このプロジェクトでは、Matplotlib、Seaborn、Pandas を使用して診察データを可視化し、計算を行います。 データセットの値は診察時に収集されたものです。
|
||||
|
||||
## データの説明
|
||||
|
||||
データセットの行は患者を表し、列は身体の測定値、さまざまな血液検査の結果、生活習慣の選択などの情報を表します。 このデータセットを使用して、心臓疾患、身体測定値、血液指標値、生活習慣の選択について、それらの間の関係を調べます。
|
||||
|
||||
ファイル名: medical_examination.csv
|
||||
|
||||
| 特徴 | 変数のタイプ | 変数 | 値のタイプ |
|
||||
|:--------------------------------------------------------:|:------:|:-----------:|:------------------------------:|
|
||||
| Age (年齢) | 客観的特徴 | age | int (日数) |
|
||||
| Height (身長) | 客観的特徴 | height | int (cm) |
|
||||
| Weight (体重) | 客観的特徴 | weight | float (kg) |
|
||||
| Gender (性別) | 客観的特徴 | gender | カテゴリコード |
|
||||
| Systolic blood pressure (最高血圧) | 検査の特徴 | ap_hi | int |
|
||||
| Diastolic blood pressure (最低血圧) | 検査の特徴 | ap_lo | int |
|
||||
| Cholesterol (コレステロール値) | 検査の特徴 | cholesterol | 1: 正常値、2: 正常値より高い、3: 正常値を優に超える |
|
||||
| Glucose (血糖値) | 検査の特徴 | gluc | 1: 正常値、2: 正常値より高い、3: 正常値を優に超える |
|
||||
| Smoking (喫煙) | 主観的特徴 | smoke | binary |
|
||||
| Alcohol intake (アルコール摂取) | 主観的特徴 | alco | binary |
|
||||
| Physical activity (身体活動状況) | 主観的特徴 | active | binary |
|
||||
| Presence or absence of cardiovascular disease (心血管疾患の有無) | 目的の変数 | cardio | binary |
|
||||
|
||||
## タスク
|
||||
|
||||
`examples/Figure_1.png` のようなグラフを作成してください。この例では、患者の `cholesterol`、`gluc`、`alco`、`active`、`smoke` について良い結果と悪い結果の数を示し、cardio=1 の場合と cardio=0 の場合を別々のパネルに表示しています。
|
||||
|
||||
`medical_data_visualizer.py` で、データを使用して次のタスクを完了してください。
|
||||
|
||||
- データに `overweight` 列を追加します。 太りすぎかどうかを判断するには、まず、体重 (キログラム単位) を身長 (メートル単位) の 2 乗で割って BMI (ボディマス指数) を計算します。 その値が 25 より大きい場合、その人は太りすぎです。 太りすぎではない場合は値 0 を使用し、太りすぎの場合は値 1 を使用します。
|
||||
- 0 を常に良とし、1 を常に悪としてデータを正規化します。 `cholesterol` または `gluc` の値が 1 の場合は、この値を 0 にします。 値が 1 より大きい場合は、値を 1 とします。
|
||||
- データを長い形式に変換し、seabornの `catplot()` を使用して、カテゴリ特徴の値の数を示すグラフを作成します。 データセットは 'Cardio' 別に分割し、`cardio` の値ごとに 1 つずつグラフを作成します。 `examples/Figure_1.png` のようなグラフを表示する必要があります。
|
||||
- データをクリーニングします。 正しくないデータを表す次の患者セグメントを除外します。
|
||||
- 最低血圧が最高血圧よりも高い (`(df['ap_lo'] <= df['ap_hi'])`) で正しいデータを維持)
|
||||
- 身長が 2.5 パーセンタイルを下回る (`(df['height'] >= df['height'].quantile(0.025))` で正しいデータを維持)
|
||||
- 身長が 97.5 パーセンタイルを上回る
|
||||
- 体重が 2.5 パーセンタイルを下回る
|
||||
- 体重が 97.5 パーセンタイルを上回る
|
||||
- データセットを使用して相関行列を作成します。 seabornの `heatmap()` を使用して相関行列をプロットします。 上側の三角形をマスク処理します。 `examples/Figure_2.png` のようなグラフを表示する必要があります。
|
||||
|
||||
変数が `None`に設定された場合は、必ず正しいコードに設定してください。
|
||||
|
||||
`test_module.py` の下に単体テストが記述してあります。
|
||||
|
||||
## 開発
|
||||
|
||||
開発には `main.py` を使用して関数をテストすることができます。 「実行」ボタンをクリックすると `main.py` が実行されます。
|
||||
|
||||
## テスト
|
||||
|
||||
すでに `test_module.py` から `main.py` にテストをインポートしてあります。 「実行」ボタンを押すと自動的にテストが実行されます。
|
||||
|
||||
## 提出
|
||||
|
||||
プロジェクトの URL をコピーし、freeCodeCamp に提出してください。
|
||||
|
||||
# --hints--
|
||||
|
||||
すべての Python テストに合格する必要があります。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
```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.
|
||||
```
|
@ -0,0 +1,60 @@
|
||||
---
|
||||
id: 5e46f802ac417301a38fb92b
|
||||
title: ページビュー時系列の可視化プログラム
|
||||
challengeType: 10
|
||||
forumTopicId: 462369
|
||||
dashedName: page-view-time-series-visualizer
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
このプロジェクトは [Replit スターターコード](https://replit.com/github/freeCodeCamp/boilerplate-page-view-time-series-visualizer)を使用して作業を行います。
|
||||
|
||||
Python カリキュラムの対話式教育コンテンツを引き続き開発中です。 現在、下記の freeCodeCamp.org YouTube チャンネルで、このプロジェクトの完了に必要なすべての知識について説明する動画をいくつか公開しています。
|
||||
|
||||
- [「みんなで Python」ビデオコース](https://www.freecodecamp.org/news/python-for-everybody/) (14 時間)
|
||||
- [「Python を学ぶ」ビデオコース](https://www.freecodecamp.org/news/learn-python-video-course/) (10 時間)
|
||||
|
||||
# --instructions--
|
||||
|
||||
このプロジェクトでは、折れ線グラフ、棒グラフ、ボックスプロットを使用して時系列データを可視化します。 Pandas、Matplotlib、Seabornを使用して、2016 年 5 月 9 日から 2019 年 12 月 3 日までの各日に freeCodeCamp.org フォーラムで発生したページビュー数を含むデータセットを視覚化します。 データを可視化することで、アクセスのパターンを把握し、年ごとおよび月ごとの増加を明らかにすることができます。
|
||||
|
||||
データを使用して、次のタスクを完了してください。
|
||||
|
||||
- Pandas を使用して "fcc-forum-pageviews.csv" からデータをインポートします。 インデックスとして "date" 列を設定します。
|
||||
- データをクリーニングするため、ページビュー数がデータセットの上位 2.5% または下位 2.5% となった日を除外します。
|
||||
- `draw_line_plot` 関数を作成します。この関数は、Matplotlib を使用して "examples/Figure_1.png" に示すような折れ線グラフを描きます。 タイトルは "Daily freeCodeCamp Forum Page Views 5/2016-12/2019" とします。 x 軸のラベルを "Date"、y 軸のラベルを "Page Views" とします。
|
||||
- `draw_bar_plot` 関数を作成します。この関数は "examples/Figure_2.png" に示すような棒グラフを描きます。 月ごとの 1 日の平均ページビュー数を表示し、年ごとにグループ化する必要があります。 凡例には月のラベルを表示し、タイトルを "Months" とします。 グラフの x 軸のラベルを "Years"、y 軸のラベルを "Average Page Views" とします。
|
||||
- `draw_box_plot` 関数を作成します。この関数は、Searborn を使用して "examples/Figure_3.png" に示すような 2 つの隣接するボックスプロットを描きます。 これらのボックスプロットでは、特定の年または月の中で値がどのように分布しているかを示し、経時的に比較できるようにする必要があります。 最初のグラフのタイトルを "Year-wise Box Plot (Trend)"、2 つ目のグラフのタイトルを "Month-wise Box Plot (Seasonality)" とします。 一番下の月ラベルの始まりを "Jan" とし、x および x 軸のラベルを正しく設定する必要があります。 ボイラープレートには、データを準備するコマンドが含まれています。
|
||||
|
||||
グラフごとに、必ずデータフレームのコピーを使用してください。 `test_module.py` の下に単体テストが記述してあります。
|
||||
|
||||
このボイラープレートには、画像を保存して返すコマンドも含まれています。
|
||||
|
||||
## 開発
|
||||
|
||||
開発には `main.py` を使用して関数をテストすることができます。 「実行」ボタンをクリックすると `main.py` が実行されます。
|
||||
|
||||
## テスト
|
||||
|
||||
すでに `test_module.py` から `main.py` にテストをインポートしてあります。 「実行」ボタンを押すと自動的にテストが実行されます。
|
||||
|
||||
## 提出
|
||||
|
||||
プロジェクトの URL をコピーし、freeCodeCamp に提出してください。
|
||||
|
||||
# --hints--
|
||||
|
||||
すべての Python テストに合格する必要があります。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
```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.
|
||||
```
|
@ -0,0 +1,64 @@
|
||||
---
|
||||
id: 5e4f5c4b570f7e3a4949899f
|
||||
title: 海面水位の予測プログラム
|
||||
challengeType: 10
|
||||
forumTopicId: 462370
|
||||
dashedName: sea-level-predictor
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
このプロジェクトは [Replit スターターコード](https://replit.com/github/freeCodeCamp/boilerplate-sea-level-predictor)を使用して作業を行います。
|
||||
|
||||
Python カリキュラムの対話式教育コンテンツを引き続き開発中です。 現在、下記の freeCodeCamp.org YouTube チャンネルで、このプロジェクトの完了に必要なすべての知識について説明する動画をいくつか公開しています。
|
||||
|
||||
- [「みんなで Python」ビデオコース](https://www.freecodecamp.org/news/python-for-everybody/) (14 時間)
|
||||
- [「Python を学ぶ」ビデオコース](https://www.freecodecamp.org/news/learn-python-video-course/) (10 時間)
|
||||
|
||||
# --instructions--
|
||||
|
||||
1880 年以降の世界的な平均海面変化のデータセットを分析します。 データを使用して、2050 年までの海面の変化を予測します。
|
||||
|
||||
データを使用して、次のタスクを完了してください。
|
||||
|
||||
- Pandas を使用して `epa-sea-level.csv` からデータをインポートします。
|
||||
- matplotlib を使用し、x 軸として "Year" 列、y 軸として "CSIRO Adjusted Sea Level" 列を使用する散布図を作成します。
|
||||
- `scipy.stats` の `linregress` 関数を使用して、最も良く当てはまる線の傾きと y 切片を得ます。 散布図の上に最良の当てはめ線 (回帰直線) を描きます。 線を 2050 年まで伸ばし、2050 年の海面上昇を予測します。
|
||||
- データセットにある 2000 年から最新年までのデータを使用し、新しい最良の当てはめ線をプロットします。 線を 2050 年まで伸ばし、2000 年以降の上昇率が続くと仮定した場合の 2050 年の海面上昇を予測します。
|
||||
- x のラベルを "Year"、y のラベルを "Sea Level (inches)" とし、タイトルを "Rise in Sea Level" とします。
|
||||
|
||||
`test_module.py` の下に単体テストが記述してあります。
|
||||
|
||||
このボイラープレートには、画像を保存して返すコマンドも含まれています。
|
||||
|
||||
## 開発
|
||||
|
||||
開発には `main.py` を使用して関数をテストすることができます。 「実行」ボタンをクリックすると `main.py` が実行されます。
|
||||
|
||||
## テスト
|
||||
|
||||
すでに `test_module.py` から `main.py` にテストをインポートしてあります。 「実行」ボタンを押すと自動的にテストが実行されます。
|
||||
|
||||
## 提出
|
||||
|
||||
プロジェクトの URL をコピーし、freeCodeCamp に提出してください。
|
||||
|
||||
## データのソース
|
||||
[世界的な海面絶対高の変化](https://datahub.io/core/sea-level-rise)、1880 ~ 2014年、米国環境保護庁提供。CSIRO (2015 年)、NOAA (2015 年) のデータを使用。
|
||||
|
||||
|
||||
# --hints--
|
||||
|
||||
すべての Python テストに合格する必要があります。
|
||||
|
||||
```js
|
||||
|
||||
```
|
||||
|
||||
# --solutions--
|
||||
|
||||
```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.
|
||||
```
|
@ -0,0 +1,54 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed4
|
||||
title: '要素、行、列へのアクセスと変更'
|
||||
challengeType: 11
|
||||
videoId: v-7Y7koJ_N0
|
||||
bilibiliIds:
|
||||
aid: 590517748
|
||||
bvid: BV1Eq4y1f7Fa
|
||||
cid: 409025392
|
||||
dashedName: accessing-and-changing-elements-rows-columns
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次の両方の Numpy 配列について 3 列目の値を 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
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,49 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed3
|
||||
title: Numpy の基本
|
||||
challengeType: 11
|
||||
videoId: f9QrZrKQMLI
|
||||
bilibiliIds:
|
||||
aid: 763014202
|
||||
bvid: BV1K64y1a7bu
|
||||
cid: 409025169
|
||||
dashedName: basics-of-numpy
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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.]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,48 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed7
|
||||
title: 配列のコピーに関する注意
|
||||
challengeType: 11
|
||||
videoId: iIoQ0_L0GvA
|
||||
bilibiliIds:
|
||||
aid: 633008569
|
||||
bvid: BV1Bb4y127fb
|
||||
cid: 409026161
|
||||
dashedName: copying-arrays-warning
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードを実行した後、`a` の値は何になりますか?
|
||||
|
||||
```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]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,65 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed6
|
||||
title: 配列の初期化の問題
|
||||
challengeType: 11
|
||||
videoId: 0jGfH8BPfOk
|
||||
bilibiliIds:
|
||||
aid: 763027834
|
||||
bvid: BV1w64y1a7eo
|
||||
cid: 409025878
|
||||
dashedName: initialize-array-problem
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のような配列を生成する別の方法は何ですか?
|
||||
|
||||
```py
|
||||
[[0. 0. 0. 0. 0. 0. 0.]
|
||||
[0. 1. 1. 1. 1. 1. 0.]
|
||||
[0. 1. 1. 1. 1. 1. 0.]
|
||||
[0. 1. 1. 5. 1. 1. 0.]
|
||||
[0. 1. 1. 1. 1. 1. 0.]
|
||||
[0. 1. 1. 1. 1. 1. 0.]
|
||||
[0. 0. 0. 0. 0. 0. 0.]]
|
||||
```
|
||||
|
||||
## --answers--
|
||||
|
||||
```py
|
||||
output = np.ones((7, 7))
|
||||
|
||||
z = np.zeros((5, 5))
|
||||
z[2, 2] = 5
|
||||
|
||||
output[1:1, -1:-1] = z
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
output = np.zeros((7,7))
|
||||
|
||||
z = np.ones((5, 5))
|
||||
z[2, 2] = 5
|
||||
|
||||
output[1:-1, 1:-1] = z
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
```py
|
||||
output = np.ones((7, 7))
|
||||
|
||||
z = np.zeros((5, 5))
|
||||
z[3, 3] = 5
|
||||
|
||||
output[1:-1, 1:-1] = z
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,48 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed5
|
||||
title: 異なる配列の初期化
|
||||
challengeType: 11
|
||||
videoId: CEykdsKT4U4
|
||||
bilibiliIds:
|
||||
aid: 718044756
|
||||
bvid: BV1MQ4y1k7BB
|
||||
cid: 409025638
|
||||
dashedName: initializing-different-arrays
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードは何を表示しますか?
|
||||
|
||||
```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]]
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
2
|
||||
|
@ -0,0 +1,60 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600eda
|
||||
title: データの読み込みと高度なインデックス作成
|
||||
challengeType: 11
|
||||
videoId: tUdBZ7pF8Jg
|
||||
bilibiliIds:
|
||||
aid: 720524642
|
||||
bvid: BV1xQ4y1r7mu
|
||||
cid: 409027117
|
||||
dashedName: loading-data-and-advanced-indexing
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次の内容を含む `data.txt` という名前のファイルが与えられます。
|
||||
|
||||
<pre>
|
||||
29,97,32,100,45
|
||||
15,88,5,75,22
|
||||
</pre>
|
||||
|
||||
次の配列を生成するコードはどれですか?
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
3
|
||||
|
@ -0,0 +1,53 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed8
|
||||
title: 算術演算
|
||||
challengeType: 11
|
||||
videoId: 7txegvyhtVk
|
||||
bilibiliIds:
|
||||
aid: 890533226
|
||||
bvid: BV1KP4y1h733
|
||||
cid: 409026503
|
||||
dashedName: mathematics
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次のコードを実行した後、`b` の値は何になりますか?
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
@ -0,0 +1,53 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed9
|
||||
title: 配列の再編成
|
||||
challengeType: 11
|
||||
videoId: VNWAQbEM-C8
|
||||
bilibiliIds:
|
||||
aid: 548035655
|
||||
bvid: BV1fq4y1N7aC
|
||||
cid: 409026755
|
||||
dashedName: reorganizing-arrays
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
次の配列を生成するコードはどれですか?
|
||||
|
||||
```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)
|
||||
```
|
||||
|
||||
## --video-solution--
|
||||
|
||||
1
|
||||
|
@ -0,0 +1,38 @@
|
||||
---
|
||||
id: 5e9a0a8e09c5df3cc3600ed2
|
||||
title: Numpy とは
|
||||
challengeType: 11
|
||||
videoId: 5Nwfs5Ej85Q
|
||||
bilibiliIds:
|
||||
aid: 293086867
|
||||
bvid: BV1Tf4y1E7QZ
|
||||
cid: 409024791
|
||||
dashedName: what-is-numpy
|
||||
---
|
||||
|
||||
# --question--
|
||||
|
||||
## --text--
|
||||
|
||||
Numpy の配列が通常の Python のリストよりも高速なのはなぜですか?
|
||||
|
||||
## --answers--
|
||||
|
||||
Numpy はオブジェクトを繰り返し処理する際に型チェックを行わないから。
|
||||
|
||||
---
|
||||
|
||||
Numpy は固定の型を使用するから。
|
||||
|
||||
---
|
||||
|
||||
Numpy は連続したメモリを使用するから。
|
||||
|
||||
---
|
||||
|
||||
上記のすべて。
|
||||
|
||||
## --video-solution--
|
||||
|
||||
4
|
||||
|
Reference in New Issue
Block a user