質問するログイン新規登録

回答編集履歴

1

補足追加

2020/03/11 00:01

投稿

magichan
magichan

スコア15898

answer CHANGED
@@ -14,4 +14,16 @@
14
14
  # server id os
15
15
  #0 001 Windows
16
16
  #2 003 ubuntu
17
+ ```
18
+
19
+ `server id` が 重複がなく、**Index**になっていているのでしたら、単純に Filterでもいけますね。
20
+
21
+ ```Python
22
+ df = df.set_index('server id', drop=True)
23
+ ret = df.loc[id_list]
24
+ print(ret)
25
+ # os
26
+ #server id
27
+ #001 Windows
28
+ #003 ubuntu
17
29
  ```