回答編集履歴
1
追記
test
CHANGED
@@ -29,3 +29,29 @@
|
|
29
29
|
#2 5 z
|
30
30
|
|
31
31
|
```
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
pandasのみの例です。
|
36
|
+
|
37
|
+
```Python
|
38
|
+
|
39
|
+
import pandas as pd
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
main_df = pd.DataFrame({'unique_id':[1,2,3,4],'val':list('abcd')})
|
44
|
+
|
45
|
+
new_df = pd.DataFrame({'unique_id':[3,4,5],'val':list('xyz')})
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
df = new_df[~new_df['unique_id'].isin(main_df['unique_id'])]
|
50
|
+
|
51
|
+
print(df)
|
52
|
+
|
53
|
+
# unique_id val
|
54
|
+
|
55
|
+
#2 5 z
|
56
|
+
|
57
|
+
```
|