-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: pandas qa sample app #885
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR presents a sample app that lets users run data analytics with pandas like a conversation, credits to workflows presented by pandas-ai
Example:
🔮 Welcome to EvaDB! This app lets you to run data analytics on a csv file like in a conversational manner.
You will only need to supply a path to csv file and an OpenAI API key.
📋 Enter the csv file path (press Enter to use our default csv file): [enter]
🔑 Enter your OpenAI key: [your openai key]
Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration.
===========================================
🪄 Run anything on the csv table like a conversation!
What do you want to do with the dataframe?
(enter 'exit' to exit): print out the 3 countries with the highest GDPs
⏳ Generating response (may take a while)...
+--------------------------------------------------+
✅ Script body:
# First, we need to sort the dataframe by GDP in descending order
sorted_df = df.sort_values(by='gdp', ascending=False)
# Then, we can select the top 3 countries with the highest GDPs
top_3_countries = sorted_df.head(3)['country']
# Finally, we can print out the result
print("The 3 countries with the highest GDPs are:")
for country in top_3_countries:
print(country)
+--------------------------------------------------+
🪄 Want to run it? (y/n): y
The 3 countries with the highest GDPs are:
United States
China
Japan
✅ Session ended.
===========================================