Generate Python Pandas Code for Data Analysis
Generate clean, efficient Python pandas code for data analysis tasks. Perfect for intermediate data analysts and developers working with DataFrames.
Prompt Template
Variables to Customize
[TASK_DESCRIPTION] The specific data analysis task you want to accomplish
Example: Calculate monthly sales trends and identify the top 10 products by revenue, including seasonal analysis
[DATASET_NAME] Name or description of your dataset
Example: e-commerce sales data (sales_data.csv)
[COLUMN_NAMES] The main columns in your dataset that are relevant to the analysis
Example: product_id, product_name, sale_date, quantity, unit_price, category, customer_id
[DATA_TYPES] Data types of the key columns
Example: product_id (int), product_name (str), sale_date (datetime), quantity (int), unit_price (float)
[DATASET_SIZE] Approximate size of your dataset
Example: ~50,000 rows, 2 years of data
[SPECIFIC_REQUIREMENTS] Any specific requirements, constraints, or output format needed
Example: Group by month and product category, handle missing values by forward-fill, export results to Excel with multiple sheets
Example Output
Pro Tips for Best Results
- Be specific about your data structure and column names - this helps generate more accurate code
- Mention any data quality issues you're aware of so the code includes appropriate handling
- Specify your desired output format (CSV, Excel, visualization) to get complete solutions
- Include performance requirements if working with large datasets - this will influence the suggested approach
- Ask for code explanations if you want to understand the pandas methods being used
Tags
Want 500+ Expert Prompts?
Get the Premium Prompt Pack — organized, tested, and ready to use.
Get it for $29Related Prompts You Might Like
Validate Data Entry Format
You are a data validation specialist. I need you to validate the format of data entries and identify any formatting issu...
Analyze Website Traffic Data
I need you to analyze website traffic data and provide actionable insights. Please examine the following metrics and dat...
Write Complex Excel Formulas
You are an Excel formula expert. I need you to create a complex Excel formula for the following scenario: **Data Contex...
Generate Weekly Performance Report
You are a business analyst creating a comprehensive weekly performance report. Generate a professional report based on t...
Build Customer Churn Prediction Model
You are an expert data scientist specializing in customer retention analytics. Help me build a comprehensive customer ch...
Calculate Customer Lifetime Value (CLV)
You are a customer analytics expert specializing in calculating Customer Lifetime Value (CLV). I need you to analyze the...