回答編集履歴
1
コードを短くした
test
CHANGED
@@ -46,19 +46,15 @@
|
|
46
46
|
|
47
47
|
df1.set_index('id', inplace=True)
|
48
48
|
|
49
|
-
df1_noname = df1.drop("name", axis=1)
|
50
|
-
|
51
49
|
|
52
50
|
|
53
51
|
df2 = pd.read_csv(io.StringIO(txt2), dtype={'id': 'str'})
|
54
52
|
|
55
53
|
df2.set_index('id', inplace=True)
|
56
54
|
|
57
|
-
df2_noname = df2.drop("name", axis=1)
|
58
55
|
|
59
56
|
|
60
|
-
|
61
|
-
df3 = df2
|
57
|
+
df3 = df2.drop("name", axis=1) - df1.drop("name", axis=1)
|
62
58
|
|
63
59
|
|
64
60
|
|