{"id":13411000,"url":"https://github.com/travistangvh/ChatGPT-Data-Science-Prompts","last_synced_at":"2025-03-14T16:33:50.550Z","repository":{"id":65438688,"uuid":"586758655","full_name":"travistangvh/ChatGPT-Data-Science-Prompts","owner":"travistangvh","description":"A repository of 60 useful data science prompts for ChatGPT","archived":false,"fork":false,"pushed_at":"2023-12-28T15:18:28.000Z","size":40710,"stargazers_count":1442,"open_issues_count":1,"forks_count":252,"subscribers_count":35,"default_branch":"main","last_synced_at":"2024-10-15T19:03:45.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/travistangvh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-01-09T06:47:50.000Z","updated_at":"2024-10-15T06:30:56.000Z","dependencies_parsed_at":"2024-01-23T07:49:31.103Z","dependency_job_id":null,"html_url":"https://github.com/travistangvh/ChatGPT-Data-Science-Prompts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travistangvh%2FChatGPT-Data-Science-Prompts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travistangvh%2FChatGPT-Data-Science-Prompts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travistangvh%2FChatGPT-Data-Science-Prompts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/travistangvh%2FChatGPT-Data-Science-Prompts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/travistangvh","download_url":"https://codeload.github.com/travistangvh/ChatGPT-Data-Science-Prompts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221486919,"owners_count":16830966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:10.756Z","updated_at":"2025-03-14T16:33:50.501Z","avatar_url":"https://github.com/travistangvh.png","language":null,"funding_links":[],"categories":["More lists","Others","Prompt Collections","Documentation and examples","精选开源项目合集","⚡ Productivity","Prompts","Uncategorized","🎥 Learning Resources","Prompt Libraries For Specific Use-Cases"],"sub_categories":["Lists on ChatGPT","Prompt engineering","Prompt对话指令","Resources","提示语（魔法）","Uncategorized","🌟 Want to be Featured?","Data Science"],"readme":"\u003ch1\u003e 🚀 ChatGPT Prompts for Data Science!\u003c/h1\u003e\n\n\u003cimg width=\"1000\" alt=\"ChatGPT for Data Science\" src=\"https://github.com/travistangvh/ChatGPT-Data-Science-Prompts/blob/0918355d14f61de0390cca0a8fb2ae221e24d35b/prompts/banner.png\"\u003e\n\nThe [ChatGPT](https://chat.openai.com/chat) model is a large language model trained by [OpenAI](https://openai.com) that is capable of generating human-like text. By providing it with a prompt, it can generate responses that continue the conversation or expand on the given prompt.\n\nIn this repository, you will find prompts that can be used with ChatGPT for data science purposes. It is curated by [Travis Tang](https://www.linkedin.com/in/travistang).\n\nTo get started, simply use the prompts below as input for ChatGPT. Replace everything in `[squarebrackets]` with your own to achieve results specific to your use case.\n\nYou can also view the collated prompts (including screenshots of ChatGPT's response) as a [PDF here](chatgpt-datascience-prompt.pdf) \n\nAdapted from the [Awesome ChatGPT repo](https://github.com/f/awesome-chatgpt-prompts) for Data Science.\n\n---\n# Table of Contents:\n1. [Write python](#write-python)\n2. [Explain code](#explain-code)\n3. [Optimize code](#optimize-code)\n4. [Format code](#format-code)\n5. [Translate code from one language to another](#translate-code)\n6. [Explain concepts](#explain-concepts)\n7. [Suggest ideas](#suggest-ideas)\n8. [Troubleshoot problem](#troubleshoot-problem)\n9. [Write SQL](#write-sql)\n10. [Write other Code](#write-other-code)\n11. [Misc](#misc)\n\n---\n# WRITE PYTHON\n## 1. Train Classification Model\n\u003e Prompt: I want you to act as a data scientist and code for me. I have a dataset of `[describe dataset]`. Please build a machine learning model that predicts `[target variable]`. \n\n## 2. Automatic Machine Learning\n\u003e Prompt: I want you to act as an automatic machine learning (AutoML) bot using TPOT for me. I am working on a model that predicts `[...]`. Please write Python code to find the best classification model with the highest AUC score on the test set.\n\n## 3. Tune Hyperparameter\n\u003e Prompt: I want you to act as a data scientist and code for me. I have trained a `[model name]`. Please write the code to tune the hyperparameters.\n\n## 4. Explore Data\n\u003e Prompt: I want you to act as a data scientist and code for me. I have a dataset of `[describe dataset]`. Please write code for data visualisation and exploration.\n\n## 5. Generate Data\n\u003e Prompt: I want you to act as a fake data generator. I need a dataset that has x rows and y columns: `[insert column names]`\n\n## 6. Write Regex\n\u003e Prompt: I want you to act as a coder. Please write me a regex in Python that `[describe regex]`\n\n## 7. Train Time Series\n\u003e Prompt: I want you to act as a data scientist and code for me. I have a time series dataset `[describe dataset]`. Please build a machine learning model that predicts `[target variable]`. Please use `[time range]` as train and `[time range]` as validation.\n\n## 8. Address Imbalance Data\n\u003e Prompt: I want you to act as a coder. I have trained a machine learning model on an imbalanced dataset. The predictor variable is the column `[Insert column name]`. In Python, how do I oversample and/or undersample my data?\n\n## 9. Get Feature Importance\n\u003e Prompt: I want you to act as a data scientist and explain the model's results. I have trained a decision tree model and I would like to find the most important features. Please write the code. \n\n## 10. Visualize Data with Matplotlib\n\u003e Prompt: I want you to act as a coder in Python. I have a dataset `[name]` with columns `[name]`. `[Describe graph requirements]`\n\n## 11. Visualize Image Grid Matplotlib\n\u003e Prompt: I want you to act as a coder. I have a folder of images. `[Describe how files are organised in directory]` `[Describe how you want images to be printed]`\n\n## 12. Explain Model with Lime\n\u003e Prompt: I want you to act as a data scientist and explain the model's results. I have trained a `[library name]` model and I would like to explain the output using LIME. Please write the code. \n\n\n## 13. Explain Model with Shap\n\u003e Prompt: I want you to act as a data scientist and explain the model's results. I have trained a scikit-learn XGBoost model and I would like to explain the output using a series of plots with Shap. Please write the code. \n\n## 14. Write Multithreaded Functions\n\u003e Prompt: I want you to act as a coder. Can you help me parallelize this code across threads in Python?\n\n## 15. Compare Function Speed\n\u003e Prompt: I want you to act as a software developer. I would like to compare the efficiency of two algorithms that performs the same task in Python. Please write code that helps me run an experiment that can be repeated for 5 times. Please output the runtime and other summary statistics of the experiment. `[Insert functions]`\n\n## 16. Create NumPy Array\n\u003e Prompt: I want you to act as a data scientist. I need to create a numpy array. This numpy array should have the shape of (x,y,z). Please initialize the numpy array with random values.\n\n## 17. Write Unit Test\nCredit: [@svpino](https://twitter.com/svpino)\n\u003e Prompt: I want you to act as a software developer. Please write unit tests for the function `[Insert function]`. The test cases are: `[Insert test cases]`\n\n## 18. Validate Column\n\u003e Prompt: I want you to act as a data scientist. Please write code to test if that my pandas Dataframe `[insert requirements here]`\n\n# EXPLAIN CODE\n## 19. Explain Python\nCredit: [@svpino](https://twitter.com/svpino)\n\u003e Prompt: I want you to act as a code explainer. What is this code doing? `[Insert code]`\n\n## 20. Explain SQL\n\u003e Prompt: I want you to act as a data science instructor. Can you please explain to me what this SQL code is doing? `[Insert SQL code]`\n\n## 21. Explain Google Sheets Formula\n\u003e Prompt: I want you to act as a Google Sheets formula explainer. Explain the following Google Sheets command. `[Insert formula]`\n\n# OPTIMIZE CODE\n## 22. Improve Code Speed\n\u003e Prompt: I want you to act as a software developer. Please help me improve the time complexity of the code below. `[Insert code]`\n\n## 23. Optimize Pandas\n\u003e Prompt: I want you to act as a code optimizer. Can you point out what's wrong with the following pandas code and optimize it? `[Insert code here]`\n\n## 24. Optimize Pandas Again\n\u003e Prompt: I want you to act as a code optimizer. Can you point out what's wrong with the following pandas code and optimize it? `[Insert code here]`\n\n## 25. Optimize Python\n\u003e Prompt: I want you to act as a code optimizer. The code is poorly written. How do I correct it? `[Insert code here]`\n\n## 26. Optimize SQL\n\u003e Prompt: I want you to act as a SQL code optimizer. The following code is slow. Can you help me speed it up? `[Insert SQL]`\n\n## 27. Simplify Python\n\u003e Prompt: I want you to act as a code simplifier. Can you simplify the following code? \n\n# FORMAT CODE\n## 28. Write Documentation\nCredit: [@svpino](https://twitter.com/svpino)\n\u003e Prompt: I want you to act as a software developer. Please provide documentation for func1 below. `[Insert function]`\n\n## 29. Improve Readability\n\u003e Prompt: I want you to act as a code analyzer. Can you improve the following code for readability and maintainability? `[Insert code]`\n\n## 30. Format SQL\n\u003e Prompt: I want you to act as a SQL formatter. Please format the following SQL code. Please convert all reserved keywords to uppercase `[Insert requirements]`. `[Insert Code]`\n\n# TRANSLATE CODE\n## 31. Translate Between DBMS\n\u003e Prompt: I want you to act as a coder and write SQL code for MySQL. What is the equivalent of PostgreSQL's DATE_TRUNC for MySQL?\n\n## 32. Translate Python to R\nCredit: [@svpino](https://twitter.com/svpino)\n\u003e Prompt: I want you to act as a code translator. Can you please convert the following code from Python to R? `[Insert code]`\n\n## 33. Translate R to Python\nCredit: [@svpino](https://twitter.com/svpino)\n\u003e Prompt: I want you to act as a code translator. Can you please convert the following code from R to Python? `[Insert code]`\n\n# EXPLAIN CONCEPTS\n## 34. Explain to Five-Year-Old\n\u003e Prompt: I want you to act as a data science instructor. Explain `[concept]` to a five-year-old.\n\n## 35. Explain to Undergraduate\n\u003e Prompt: I want you to act as a data science instructor. Explain `[concept]` to an undergraduate.\n\n## 36. Explain to Professor\n\u003e Prompt: I want you to act as a data science instructor. Explain `[concept]` to a professor.\n\n## 37. Explain to Business Stakeholder\n\u003e Prompt: I want you to act as a data science instructor. Explain `[concept]` to a business stakeholder.\n\n## 38. Explain Like Stackoverflow\n\u003e Prompt: I want you to act as an answerer on StackOverflow. You can provide code snippets, sample tables and outputs to support your answer. `[Insert technical question]`\n\n# SUGGEST IDEAS\n## 39. Suggest Edge Cases\n\u003e Prompt: I want you to act as a software developer. Please help me catch edge cases for this function `[insert function]`\n\n## 40. Suggest Dataset\n\u003e Prompt: I want you to act as a data science career coach. I want to build a predictive model for `[...]`. At the same time, I would like to showcase my knowledge in `[...]`. Can you please suggest the five most relevant datasets for my use case?\n\n## 41. Suggest Portfolio Ideas\n\u003e Prompt: I want you to act as a data science coach. My background is in `[...]` and I would like to `[career goal]`. I need to build a portfolio of data science projects that will help me land a role in `[...]` as a `[...]`. Can you suggest five specific portfolio projects that will showcase my expertise in `[...]` and are of relevance to `[company]`?\n\n## 42. Suggest Resources\n\u003e Prompt: I want you to act as a data science coach. I would like to learn about `[topic]`. Please suggest 3 best specific resources. You can include `[specify resource type]`\n\n## 43. Suggest Time Complexity\n\u003e Prompt: I want you to act as a software developer. Please compare the time complexity of the two algorithms below. `[Insert two functions]`\n\n## 44. Suggest Feature Engineering\n\u003e Prompt: I want you to act as a data scientist and perform feature engineering. I am working on a model that predicts `[insert feature name]`. There are columns: `[Describe columns]`. Can you suggest features that we can engineer for this machine learning problem?\n\n## 45. Suggest Ab Testing Steps\n\u003e Prompt: I want you to act as a statistician. `[Describe context]` Please design an A/B test for this purpose. Please include the concrete steps on which statistical test I should run.\n\n## 46. Career Coaching\n\u003e Prompt: I want you to act as a career advisor. I am looking for a role as a `[role name]`. My background is `[...]`. How do I land the role and with what resources exactly in 6 months?\n\n# TROUBLESHOOT PROBLEM\n## 47. Correct Own ChatGPT Code\n\u003e Prompt: Your above code is wrong. `[Point out what is wrong]`. Can you try again?\n\n## 48. Correct Python Code\n\u003e Prompt: I want you to act as a software developer. This code is supposed to `[expected function]`. Please help me debug this Python code that cannot be run. `[Insert function]`\n\n## 49. Correct SQL Code\n\u003e Prompt: I want you to act as a SQL code corrector. This code does not run in `[your DBMS, e.g. PostgreSQL]`. Can you correct it for me? `[SQL code here]`\n\n## 50. Troubleshoot PowerBI Model\nCredit: [Mathias Halkjær Petersen](https://www.linkedin.com/in/mhalkjaer/)\n\u003e Prompt: I want you to act as a Power BI modeler. Here is the details of my current project. `[Insert details]`. Do you see any problems with the table?\n\n# WRITE SQL\n## 51. Create Running Average\n\u003e Prompt: I want you to act as a data scientist and write SQL code for me. I have a table with two columns `[Insert column names]`. I would like to calculate a running average for `[which value]`. What is the SQL code that works for PostgreSQL 14?\n\n## 52. Solve Leetcode Question\nCredit: [DataLemur](www.datalemur.com)\n\u003e Prompt: Assume you are given the tables... with the columns... Output the following... `[Question from Data Lemur)`\n\n# WRITE OTHER CODE\n## 53. Write Google Sheets Formula\n\u003e Prompt: I want you to act as a bot that generates Google Sheets formula. Please generate a formula that `[describe requirements]`\n\n## 54. Write R\n\u003e Prompt: I want you to act as a data scientist using R. Can you write an R script that `[Insert requirement here]`\n\n## 55. Write Shell\n\u003e Prompt: I want you to act as a Linux terminal expert. Please write the code to `[describe requirements]`\n\n## 56. Write VBA\n\u003e Prompt: I want you to act as an Excel VBA developer. Can you write a VBA that `[Insert function here]`?\n\n# MISC\n## 57. Format Tables\n\u003e Prompt: I want you to act as a document formatter. Please format the following into a nice table for me to place in Google Docs? `[insert text table here]`\n\n## 58. Summarize Book\n\u003e Prompt: I want you to act as a technical book summarizer. Can you please summarize the book `[name]` with 5 main points?\n\n## 59. Summarize Paper\n\u003e Prompt: I want you to act as an academic. Please summarise the paper `[...]` in simple terms in one paragraph.\n\n## 60. Provide Emotional Support\n\u003e Prompt: I want you to provide emotional support to me. `[Explain problem here.]`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravistangvh%2FChatGPT-Data-Science-Prompts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftravistangvh%2FChatGPT-Data-Science-Prompts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftravistangvh%2FChatGPT-Data-Science-Prompts/lists"}