回答編集履歴
1
追記
answer
CHANGED
@@ -9,4 +9,14 @@
|
|
9
9
|
```python
|
10
10
|
student_data_math.select_dtypes(include='number') \
|
11
11
|
.pipe(lambda df: df.std(ddof=0) / df.mean())
|
12
|
+
```
|
13
|
+
追記
|
14
|
+
----
|
15
|
+
`mean()`と`std()`しか計算しないなら、`numeric_only=True`を指定して数値カラムだけを計算するようにしてもよいと思います。
|
16
|
+
|
17
|
+
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.mean.html
|
18
|
+
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.std.html
|
19
|
+
|
20
|
+
```python
|
21
|
+
student_data_math.std(ddof=0, numeric_only=True) / student_data_math.mean(numeric_only=True)
|
12
22
|
```
|