-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please try later #7
Comments
+1 on the issue. Facing the same. Hello @alessioricco , @alessiodashydash , @kairavdashydash , @muhammad-abdullah-dashy-dash , I believe this issue is occurring as the code is using I am happy to submit a PR if you are fine with the proposed fix or if you have other fixes, happy to discuss. |
+1 same here. @deathsaber if you think you can fix the issue, I'd say submit the PR and let's see if @alessioricco @alessiodashydash can approve and merge. |
@elgaeloHub - Well, I tried pushing a fix but my push got rejected.
I'm guessing the authors of the repo plan to archive it due to the RCE mentioned in issue 5. If your use-case is running natural language queries on structured data, I'd advice you check out this library. It's working great for me. If you still wanna use
|
Hi All, |
@Pranathipatelhe @deathsaber, the problem is not the version of the open library because, in the requirements.txt, the correct library is defined as the old one. I will change it so we can support the new classes. |
Code:
import os
import pandas as pd
from pandas_llm import PandasLLM
Data
Please note that these names, ages, and donations are randomly generated
and do not correspond to real individuals or their donations.
data = [('John Doe', 25, 50),
('Jane Smith', 38, 70),
('Alex Johnson', 45, 80),
('Jessica Brown', 60, 40),
('Michael Davis', 22, 90),
('Emily Wilson', 30, 60),
('Daniel Taylor', 35, 75),
('Sophia Moore', 40, 85),
('David Thomas', 50, 65),
('Olivia Jackson', 29, 55)]
df = pd.DataFrame(data, columns=['name', 'age', 'donation'])
conv_df = PandasLLM(data=df, llm_api_key =API_KEY)
result = conv_df.prompt("What is the average donation of people older than 40 who donated more than $50?")
code = conv_df.code_block
print(f"Executing the following expression of type {type(result)}:\n{code}\n\nResult is:\n {result}\n")
Executing the following expression of type <class 'numpy.float64'>:
result = df.loc[(df['age'] > 40) & (df['donation'] > 50), 'donation'].mean()
Result is:
72.5
Error:
UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
conv_df = PandasLLM(data=df, llm_api_key =API_KEY)
Executing the following expression of type <class 'str'>:
Result is:
Please try later
Even though I am trying with same code which is given in the pandas-llm documentation, I always encounter with 'Please try later' response.
@alessioricco @alessiodashydash @kairavdashydash @muhammad-abdullah-dashy-dash
The text was updated successfully, but these errors were encountered: