Skip to content
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
merged 30 commits into from
Jun 26, 2023
Merged

feat: pandas qa sample app #885

merged 30 commits into from
Jun 26, 2023

Conversation

yulaicui
Copy link
Contributor

@yulaicui yulaicui commented Jun 22, 2023

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.
===========================================

@yulaicui yulaicui requested review from jarulraj and gaurav274 June 23, 2023 00:10
@yulaicui yulaicui changed the title Pandas qa feat: pandas qa sample app Jun 23, 2023
@jarulraj jarulraj merged commit 54a8c43 into master Jun 26, 2023
@jarulraj jarulraj deleted the pandas_qa branch June 26, 2023 03:13
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants