Skip to content

Error when running colab #72

Open
Open
@Tizzzzy

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 Cell 5 line 1
----> 1 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, 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, 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, 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions