abhijithneilabraham / abhijithneilabraham/tableQA

Error when running colab

Đang mở
#72 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
320
Fork
45
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.