質問編集履歴

1

ちょっと

2020/01/10 10:10

投稿

Taka_Yamag
Taka_Yamag

スコア29

test CHANGED
File without changes
test CHANGED
@@ -41,183 +41,3 @@
41
41
  また、SELECT * FROM TABLEB WHERE ID =1のようなサブクエリでAを絞りたいのですが、それはどのようにすれば可能でしょうか?
42
42
 
43
43
  よろしくお願いいたします。
44
-
45
-
46
-
47
- ------------------------------------------------------------------------------
48
-
49
- KeyError Traceback (most recent call last)
50
-
51
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
52
-
53
- 2441 try:
54
-
55
- -> 2442 return self._engine.get_loc(key)
56
-
57
- 2443 except KeyError:
58
-
59
-
60
-
61
- pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
62
-
63
-
64
-
65
- pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
66
-
67
-
68
-
69
- pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
70
-
71
-
72
-
73
- pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
74
-
75
-
76
-
77
- KeyError: 'jigyosho_id'
78
-
79
-
80
-
81
- During handling of the above exception, another exception occurred:
82
-
83
-
84
-
85
- KeyError Traceback (most recent call last)
86
-
87
- <ipython-input-7-d26fb13a76b7> in <module>()
88
-
89
- ----> 1 pd.merge(df_homonkei_service_riyosha, df_homonkei_service_kaigo, on='jigyosho_id')
90
-
91
-
92
-
93
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/reshape/merge.py in merge(left, right, how, on, left_on, right_on, left_index, right_index, sort, suffixes, copy, indicator)
94
-
95
- 51 right_on=right_on, left_index=left_index,
96
-
97
- 52 right_index=right_index, sort=sort, suffixes=suffixes,
98
-
99
- ---> 53 copy=copy, indicator=indicator)
100
-
101
- 54 return op.get_result()
102
-
103
- 55
104
-
105
-
106
-
107
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/reshape/merge.py in __init__(self, left, right, how, on, left_on, right_on, axis, left_index, right_index, sort, suffixes, copy, indicator)
108
-
109
- 556 (self.left_join_keys,
110
-
111
- 557 self.right_join_keys,
112
-
113
- --> 558 self.join_names) = self._get_merge_keys()
114
-
115
- 559
116
-
117
- 560 # validate the merge keys dtypes. We may need to coerce
118
-
119
-
120
-
121
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/reshape/merge.py in _get_merge_keys(self)
122
-
123
- 808 if not is_rkey(rk):
124
-
125
- 809 if rk is not None:
126
-
127
- --> 810 right_keys.append(right[rk]._values)
128
-
129
- 811 else:
130
-
131
- 812 # work-around for merge_asof(right_index=True)
132
-
133
-
134
-
135
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/frame.py in __getitem__(self, key)
136
-
137
- 1962 return self._getitem_multilevel(key)
138
-
139
- 1963 else:
140
-
141
- -> 1964 return self._getitem_column(key)
142
-
143
- 1965
144
-
145
- 1966 def _getitem_column(self, key):
146
-
147
-
148
-
149
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/frame.py in _getitem_column(self, key)
150
-
151
- 1969 # get column
152
-
153
- 1970 if self.columns.is_unique:
154
-
155
- -> 1971 return self._get_item_cache(key)
156
-
157
- 1972
158
-
159
- 1973 # duplicate columns & possible reduce dimensionality
160
-
161
-
162
-
163
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/generic.py in _get_item_cache(self, item)
164
-
165
- 1643 res = cache.get(item)
166
-
167
- 1644 if res is None:
168
-
169
- -> 1645 values = self._data.get(item)
170
-
171
- 1646 res = self._box_item_values(item, values)
172
-
173
- 1647 cache[item] = res
174
-
175
-
176
-
177
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/internals.py in get(self, item, fastpath)
178
-
179
- 3588
180
-
181
- 3589 if not isnull(item):
182
-
183
- -> 3590 loc = self.items.get_loc(item)
184
-
185
- 3591 else:
186
-
187
- 3592 indexer = np.arange(len(self.items))[isnull(self.items)]
188
-
189
-
190
-
191
- ~/.pyenv/versions/anaconda3-5.0.0/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
192
-
193
- 2442 return self._engine.get_loc(key)
194
-
195
- 2443 except KeyError:
196
-
197
- -> 2444 return self._engine.get_loc(self._maybe_cast_indexer(key))
198
-
199
- 2445
200
-
201
- 2446 indexer = self.get_indexer([key], method=method, tolerance=tolerance)
202
-
203
-
204
-
205
- pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
206
-
207
-
208
-
209
- pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
210
-
211
-
212
-
213
- pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
214
-
215
-
216
-
217
- pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
218
-
219
-
220
-
221
- KeyError: 'jigyosho_id'
222
-
223
- ------------------------------------------------------------------------------