abhijithneilabraham / abhijithneilabraham/tableQA

Error when running colab

Open
#72 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
320
Forks
45
PR merge metrics
No merged PRs in 30d

Description

I am running the colab code in local using python 3.8.18, and it seems like I have successfully downloaded all the package, but when I run "agent.query_db("how many deaths of age below 40 had stomach cancer?")", it shows this error. Strangely, I can run this line "agent.get_query("how many deaths of age below 40 had stomach cancer?")"
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
[c:\Users\super\OneDrive\Desktop\research\tableQA.ipynb](file:///C:/Users/super/OneDrive/Desktop/research/tableQA.ipynb) Cell 5 line 1
----> [1](vscode-notebook-cell:/c%3A/Users/super/OneDrive/Desktop/research/tableQA.ipynb#W4sZmlsZQ%3D%3D?line=0) agent.query_db("how many deaths of age below 40 had stomach cancer?")

File [c:\Users\super\anaconda3\envs\nextgpt\lib\site-packages\tableqa\agent.py:72](file:///C:/Users/super/anaconda3/envs/nextgpt/lib/site-packages/tableqa/agent.py:72), in Agent.query_db(self, question, verbose, chart, size)
70 database = Database(self.data_dir, self.schema_dir)
71 create_db = getattr(database, self.db_type)
---> 72 engine = create_db(question)
73 answer = engine.execute(query).fetchall()
74 if chart is not None:

File [c:\Users\super\anaconda3\envs\nextgpt\lib\site-packages\tableqa\database.py:26](file:///C:/Users/super/anaconda3/envs/nextgpt/lib/site-packages/tableqa/database.py:26), in Database.sqlite(self, question)
24 data_frame=self.data_process.get_dataframe(csv).astype(str)
25 schema=self.data_process.get_schema_for_csv(csv)
---> 26 data_frame = data_frame.fillna(data_frame.mean())
27 sql_schema = {}
28 for col in schema['columns']:

File [c:\Users\super\anaconda3\envs\nextgpt\lib\site-packages\pandas\core\generic.py:11556](file:///C:/Users/super/anaconda3/envs/nextgpt/lib/site-packages/pandas/core/generic.py:11556), in NDFrame._add_numeric_operations..mean(self, axis, skipna, numeric_only, **kwargs)
11539 @doc(
11540 _num_doc,
11541 desc="Return the mean of the values over the requested axis.",
(...)
11554 **kwargs,
...
46 def _sum(a, axis=None, dtype=None, out=None, keepdims=False,
47 initial=_NoValue, where=True):
---> 48 return umr_sum(a, axis, dtype, out, keepdims, initial, where)

TypeError: can only concatenate str (not "int") to str

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.