Attempting to write a DataFrame/Series with an integer index that does not contain zero will throw an exception:
df = DataFrame({'k':[1,2,3],'v':['a','b','c']}).set_index('k')
q.sync('`test set',df)
File "C:\Anaconda3\envs\pyq\lib\site-packages\qpython\_pandas.py", line 157, in _write_pandas_series
qtype = Q_TYPE.get(type(data[0]), QGENERAL_LIST)
KeyError: 0
This is caused by the data[0] lookup. With a non-numeric index data[0] will return the first row as expected, however when the index is numeric it will search for 0 and find nothing. Explicit indexing by row number (via iloc) fixes the issue.
Attempting to write a DataFrame/Series with an integer index that does not contain zero will throw an exception:
This is caused by the data[0] lookup. With a non-numeric index data[0] will return the first row as expected, however when the index is numeric it will search for 0 and find nothing. Explicit indexing by row number (via iloc) fixes the issue.