NIUBOYI»Home › › Chatgpt › 中文 | English
微信扫一扫 分享朋友圈

已有 1186 人浏览分享

[提示词]    60 data science task prompts, including programming languages and natural language.

提示词 2024-3-18 22:11:291186 0
ChatGPT has taken the (data) world by storm and is growing into one of the super tools across a variety of tasks. In this article, we will focus on useful prompts that data scientists can use in ChatGPT as part of their data workflows.

I. Prompts for General Coding Workflows

Code Debugging Workflow

Debug Python Code

I want you to act as a Python programmer. This is a piece of Python code containing {问题} - {插入代码片段} - and I received the following error {插入错误}. What is the cause of this bug?

Debug R Code
I want you to act as an R programmer. Here is a piece of R code containing {问题} — {插入代码片段} — and I received the following error {插入错误}. What is the cause of this bug?

Debug SQL Code
I want you to act as a SQL programmer. Here is a piece of SQL code containing {问题} — {插入代码片段} — and I received the following error {插入错误}. What is the cause of this bug?

Code Explanation Workflow

Python Code Explanation
I want you to act as a Python code explainer. I do not understand this function. Can you explain what it does and provide an example? {插入函数}

R Code Explanation
I want you to act as a code explainer in R. I do not understand this function. Can you explain what it does and provide an example? {插入函数}

SQL Code Explanation
I want you to act as a SQL code explainer. I do not understand this snippet. Can you explain what it does and provide an example? {插入SQL查询}

Code Optimization Workflow

Python Code Optimization
I want you to act as a code optimizer in Python. {如果可能,请描述当前代码的问题}. Can you make the code {更Pythonic/更干净/更高效/运行更快/更具可读性}? {插入代码}

R Code Optimization
I want you to act as a code optimizer in R. {如果可能,请描述当前代码的问题}. Can you make the code {更干净/更高效/运行更快/更具可读性}? {插入代码}

SQL Code Optimization
I want you to act as a query optimizer in SQL. {如果可能,请描述当前代码的问题}. Can you suggest how to make the query {运行得更快/更具可读性/更简单}? {插入代码}

Code Simplification Workflow

Python Code Simplification
I want you to play the role of a Python programmer. Please simplify this code while ensuring it is {高效/易于阅读/Pythonic}? {插入代码}

R Code Simplification
I want you to play the role of an R programmer. Please simplify this code while ensuring it is {高效/易于阅读}? {插入代码}

SQL Code Simplification
I want you to play the role of a SQL programmer. I am running {PostgreSQL 14/MySQL 8/SQLite 3.4/其他版本。}. Can you simplify this query {同时确保其高效/易于阅读/插入任何其他要求}?

Code Translation Workflow

Translate Code from R to Python
I want you to play the role of an R programmer. Please translate this code into Python. {插入代码}

Translate Code from Python to R
I want you to play the role of a Python programmer. Please translate this code into R. {插入代码}

Code Quality and Testing Workflow

Compare Function Speed in Python
I want you to play the role of a Python programmer. Can you write code to compare the speed of two functions {functionname} and {functionname}? {插入函数}

Write Unit Tests in R
I want you to act as an R programmer. Can you write unit tests for the function {functionname}? {插入单元测试的要求(如果有的话)} {插入代码}

Write Unit Tests in Python
I want you to play the role of a Python programmer. Can you write unit tests for the function {functionname}? {插入单元测试的要求(如果有的话)} {插入代码}

II. Prompts for Data Analysis Workflows


SQL Data Analysis Workflow

Data Generation and Table Creation
I want you to act as a data generator. You can write SQL queries in {数据库版本} to create a table {表名称} with columns {列名称}. Include relevant constraints and indexes.

Common Table Expressions
I want you to play the role of a SQL code programmer. I am running {数据库版本}. Can you rewrite this query using a CTE? {插入查询}

Writing SQL Queries in Natural Language

Example: Data Aggregation in SQL
I want you to play the role of a data scientist. {插入表格的描述}. Can you perform {计数/求和/取平均值} on {值} for {插入过滤器}

Example: 7-Day Running Average in SQL
I want you to play the role of a data scientist. I am running {PostgreSQL 14/MySQL 8/SQLite 3.4/其他版本。}. I have tables {table_name}, which are {table description}. The sales table consists of columns {列名}. Can you write a query to find the 7-day running average of {quantity}?

Example: Window Functions in SQL
I want you to play the role of a data scientist. I am running {PostgreSQL 14/MySQL 8/SQLite 3.4/其他版本。}. I have tables {table_name}, which are {table description}. The sales table consists of columns {列名}. Can you write a query that finds {required window function}?

Example: Window Functions in SQL
I want you to play the role of a data scientist. I am running {PostgreSQL 14/MySQL 8/SQLite 3.4/其他版本。}. I have tables {table_name}, which are {table description}. The sales table consists of columns {列名}. Can you write a query that finds {required window function}?

Python Data Analysis Workflow

Data Generation Workflow

Example: Generate Markdown
I want you to act as a data generator in Python. Can you generate a Markdown file containing {数据要求}? Save the file to {filename}

Example: Generate CSV
I want you to act as a data generator in Python. Can you generate a CSV file containing {数据要求}. Save the file to {filename}

Example: Generate JSON
I want you to act as a data generator in Python. Can you generate a JSON file containing {数据要求}. Save the file to {filename}

Data Cleaning Workflow
I want you to play the role of a data scientist programming with Python Pandas. Given a CSV file containing data for {dataframe name}, where the columns of {dataset context} are {colum name}, please write code to clean the data? {插入数据要求}

Data Analysis Workflow in pandas

Example: Data Aggregation
I want you to play the role of a data scientist programming with Python Pandas. Given a table {table name} consisting of columns {column name}, can you write a query to find {requirement}?

Example: Data Merging
I want you to play the role of a data scientist programming with Python Pandas. Given a table {table 1 name} consisting of columns {column name} and another table {table 2 name} consisting of columns {column name}, please merge the two tables. {插入附加要求,如果有的话}

Example: Data Reshaping
I want you to play the role of a data scientist programming with Python Pandas. Given a table {table name} consisting of columns {column}, can you aggregate {value} by {column} and convert it from long format to wide format?

Example: Generate Markdown
I want you to act as a data generator in R. Can you generate a Markdown file containing {数据要求}? Save the file to {filename}

R Data Analysis Workflow

Data Generation Workflow

Example: Generate Markdown
I want you to act as a data generator in R. Can you generate a Markdown file containing {数据要求}? Save the file to {filename}

Example: Generate CSV
I want you to act as a data generator in R. Can you generate a CSV file containing {数据要求}? Save the file to {filename}

Example: Generate JSON
I want you to act as a data generator in R. Can you generate a JSON file containing {数据需求}? Save the file to {filename}

Data Cleaning Workflow
I want you to act as a data scientist programming with R tidyr. You will be given a data frame {dataframe name} containing columns {column name}. {插入要求}

Data Analysis Workflow in tidyr

Data Aggregation
I want you to act as a data scientist programming with R tidyr. You will be given a data frame {dataframe name} containing columns {column name}. {插入要求}

Data Merging
I want you to act as a data scientist programming with R tidyr. You will be given a data frame {dataframe 1 name} containing columns {column name}. You also have a data frame {dataframe 2 name} containing columns {column name}. Find {所需的输出}

Example: Data Reshaping (Long to Wide)
I want you to act as a data scientist programming with R tidyr. You will be given a data frame {dataframe name} containing columns {column name}. Please convert the data to wide format.

Example: Data Reshaping (Wide to Long)
I want you to act as a data scientist programming with R tidyr. You will be given a data frame {dataframe name} containing columns {column name}. Please convert the data to long format.

III. Prompts for Data Visualization Workflows

R Data Visualization Workflow

Create a Plot in ggplot2
I want you to act as a data scientist coding in R. Given a data frame {数据框名称} containing columns {列名称}, use ggplot2 to plot {图表类型和要求}.

Gridplot Visualization in ggplot2
I want you to act as a data scientist coding in R. Given a data frame {dataframe name} containing columns {column name}. Use ggplot2 to draw a pair plot showing the relationship of one variable with another.

Annotating and Formatting Plots
I want you to act as a data scientist coding in R. Given a data frame {dataframe name} containing columns {列名称}, use ggplot2 to draw a {图表类型} of the relationship between {变量}. {插入注释和格式要求}

Change the Plot Theme in ggplot2
I want you to act as a data scientist coding in R. Given a data frame {dataframe name} containing columns {列名称}, use ggplot2 to draw a {图表类型} of the relationship between {变量}. Change the color theme to match {theme}

Python Data Visualization Workflow
Create a Plot Using matplotlib
I want you to play the role of a data scientist coding in Python. Given a data frame {dataframe name} containing columns {列名称}, use matplotlib to plot {图表类型和要求}.

Create a Pair Plot Using matplotlib
I want you to play the role of a data scientist coding in Python. Given a data frame {dataframe name} containing columns {column name}. Use matplotlib to draw a pair plot showing the relationship of one variable with another.

Annotate and Format Plots in matplotlib
I want you to play the role of a data scientist coding in Python. Given a data frame {dataframe name} containing columns {列名称}, use matplotlib to draw a {图表类型} of the relationship between {变量}. {插入注释和格式要求}

Change the Plot Theme in matplotlib
I want you to play the role of a data scientist coding in Python. Given a data frame {dataframe name} containing columns {列名称}, use matplotlib to draw a {图表类型} of the relationship between {变量}. Change the color theme to match {theme}

IV. Prompts for Machine Learning Workflows

General Machine Learning Workflow

Feature Engineering Ideas
I want you to play the role of a data scientist. Given the {数据集名称} dataset containing {列}, you want to predict {预测变量}. Suggest data helpful for this problem and perform feature engineering for this problem.

Python Machine Learning Workflow
Model Training Workflow
I want you to play the role of a data scientist programming in Python. Given a {数据帧名称} dataset containing {列名称}, write code to predict {输出变量}.

Hyperparameter Tuning Workflow
I want you to play the role of a data scientist programming in Python. Given a {type of model} model, write code to tune hyperparameters.

Model Interpretability Workflow
I want you to play the role of a data scientist programming in Python. Given a {模型类型} that predicts {预测变量}, write code to explain the output using Shap values.

R Machine Learning Workflow

Model Training Workflow
I want you to play the role of a data scientist programming in R. Given a {dataframe name} data frame containing {列名称}, write code to predict {output}.

Hyperparameter Tuning Workflow
I want you to play the role of a data scientist programming in R. Given a {模型类型} model, write code to tune hyperparameters.

Model Interpretability Workflow
I want you to play the role of a data scientist programming in R. Given a {模型类型} that predicts {预测变量}, write code to explain the output using Shap values.


V. Prompts for Time Series Analysis Workflows


Python Time Series Analysis Workflow

Change the Time Range Using pandas
I want you to play the role of a data scientist coding in Python. Given time series data in a Pandas data frame {数据帧名称}, with a timestamp index at {原始频率} frequency, where one column is {列名称}, convert the timestamp frequency to {所需频率}.

Build a Test Series Model
I want you to play the role of a data scientist coding in Python. Given time series data in data frame {数据帧名称}, with a timestamp index at {原始频率} frequency, with one column {列名称}, build a prediction model assuming the data is stationary.

Perform Stationarity Test
I want you to play the role of a data scientist coding in Python. Given time series data in data frame {数据帧名称}, with a timestamp index at {原始频率} frequency, with one column {列名称}, perform the Dicky Fuller test.

R Time Series Analysis Workflow

Change the Time Range
I want you to play the role of a data scientist coding in R. Given time series data in data frame {数据帧名称}, where the timestamp index is a column {列名称} in {原始频率} frequency, convert the timestamp frequency to {所需频率}.

Change the Time Range
I want you to play the role of a data scientist coding in R. Given time series data in data frame {数据帧名称}, where the timestamp index is a column {列名称} in {原始频率} frequency, convert the timestamp frequency to {所需频率}

Perform Stationarity Test
I want you to play the role of a data scientist coding in R. Given time series data in data frame {数据帧名称}, with a timestamp index at {原始频率} frequency, with one column {列名称}, perform the Dicky Fuller test.

VI. Prompts for Natural Language Processing Workflows

Classify Text Sentiment
I want you to act as a sentiment classifier. Classify the following text from {描述文本来源} as "positive", "negative", "neutral", or "uncertain": {插入要分类的文本}.

Create a Regular Expression
I want you to play the role of a programmer coding in Python, using regular expressions to test whether a string {插入要求}.

Text Dataset Generation
I want you to act as a dataset generator. Please generate {number of text} texts according to {required text and the context}. {插入附加要求}.

Machine Translation
I want you to act as a translator. Please translate {phrase} from {origin language} to {translated language}.

Conceptual and Career-Oriented Prompts

Explain Data Concepts to Business Executives
I want you to act as a data scientist at a company. {如果需要,请详细描述内容} Please explain to a business executive the meaning of {概念}.

Summarize Articles/Papers
I want you to act as a data scientist at a research-oriented startup. Please explain the paper {论文} according to {难度级别,例如软件开发人员、五岁儿童、企业高管、教授}.

Suggest Portfolio Projects and Ideas
I want you to act as a data science career coach. I am {描述您的背景}, and I want to {描述职业目标}. Suggest portfolio projects and ideas {描述投资组合的目标}

Write a Tutorial
I want you to act as a data scientist writer. Please write a {number-of-words}-word introduction for a tutorial on {title}. {插入相关要点}.
  • WeChat Official Account

  • Scan to Visit Mobile Site

QQ|NIUBOYI ( 京ICP备17025393号 )|网站地图

GMT+8, 2026-10-31 07:15 , Processed in 0.050830 second(s), 38 queries .

POWERED BY NIUBOYIAI! 主理人:NIUBOYIAI  点亮哥

Copyright © 2001-2020, NIUBOYI AI.