-
Notifications
You must be signed in to change notification settings - Fork 32
Description
First started with a SQLite database but couldn't get it running properly. Switched to MySQL and everything runs until this traceback occurs
Traceback (most recent call last):
File "consolidate.py", line 182, in
join('disambiguator.csv')
File "consolidate.py", line 167, in join
old[0] = old[0].astype(str)
File "/home/user/patentprocessor/venv/local/lib/python2.7/site-packages/pandas/core/frame.py", line 2003, in getitem
return self._get_item_cache(key)
File "/home/user/patentprocessor/venv/local/lib/python2.7/site-packages/pandas/core/generic.py", line 667, in _get_item_cache
values = self._data.get(item)
File "/home/user/patentprocessor/venv/local/lib/python2.7/site-packages/pandas/core/internals.py", line 1655, in get
_, block = self._find_block(item)
File "/home/user/patentprocessor/venv/local/lib/python2.7/site-packages/pandas/core/internals.py", line 1935, in _find_block
self._check_have(item)
File "/home/user/patentprocessor/venv/local/lib/python2.7/site-packages/pandas/core/internals.py", line 1942, in _check_have
raise KeyError('no item named %s' % com.pprint_thing(item))
KeyError: u'no item named 0'
It turns out that line 165 and 166
old = s.execute('select uuid, inventor_id from rawinventor where inventor_id != "";')
old = pd.DataFrame.from_records(old.fetchall())
produce an empty dataframe because there are no recorded inventor_ids in the table.