Compute feature correlations with target
Identify predictive features
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Write Python code to compute the correlation between all features and the target variable [target] in DataFrame df. Use Pearson for numerical features, point-biserial for binary vs continuous, and Cramér's V for categorical vs categorical. Output a ranked table of correlation strengths.
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Use Cases
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Pensez à convertir les variables catégorielles en type `category` et à gérer les NaN (`dropna()`) avant de lancer vos fonctions. Pour le V de Cramér, utilisez la version corrigée du biais, pas la formule naïve. Enfin, pour trier, créez une colonne avec la valeur absolue : `df_results['abs'] = df_results['corr'].abs()` puis `sort_values('abs', ascending=False)`.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Getting started with Python and Pandas for analysis
Complete beginner guide to data analysis with Python Pandas, from data loading to first visualizations.
Claude Prompt for Analyzing Data
Data analysis has become a strategic lever for any organization seeking to make informed decisions. Claude excels at interpreting complex datasets, whether CSV tables, survey results, financial metrics, or application logs. Unlike traditional analysis tools that require advanced technical skills, Claude allows you to obtain actionable insights in natural language. You can submit raw data and ask it to identify trends, anomalies, correlations, or hidden patterns. It can segment your data, calculate descriptive statistics, formulate explanatory hypotheses, and suggest relevant visualizations. Whether you are a seasoned data analyst looking to speed up your exploratory workflow, or a non-technical decision-maker wanting to understand a report, Claude adapts to your level of expertise. It transforms raw numbers into understandable narratives, concrete recommendations, and measurable action plans. This page offers optimized prompts to get the most out of Claude in your daily data analysis.
Design a simple ETL pipeline
Design a complete ETL pipeline with error handling, monitoring, and Python code for multi-source data integration.
Implement shadow deployment
Safely deploy new ML models