回答編集履歴
1
修正
test
CHANGED
@@ -2,8 +2,16 @@
|
|
2
2
|
|
3
3
|
```python
|
4
4
|
|
5
|
+
df=pd.DataFrame([[100,110,130],[150,120,100],[100,100,120],[130,150,160]],columns=["血圧","血糖","脂質"])
|
6
|
+
|
5
|
-
df[pd.concat([df["血圧"]>=130, df["血糖"]>=110, df["脂質"]>150],axis=1).sum(axis=1)>=2]
|
7
|
+
print(df[pd.concat([df["血圧"]>=130, df["血糖"]>=110, df["脂質"]>=150],axis=1).sum(axis=1)>=2])
|
6
8
|
|
7
9
|
|
8
10
|
|
11
|
+
# 血圧 血糖 脂質
|
12
|
+
|
13
|
+
# 1 150 120 100
|
14
|
+
|
15
|
+
# 3 130 150 160
|
16
|
+
|
9
17
|
```
|