Detect outliers
Identify and handle outliers
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Write Python code to detect outliers in the numerical columns of DataFrame df using three methods: IQR method, Z-score (threshold=3), and Isolation Forest. Compare results, visualize outliers with box plots, and recommend which method is most appropriate for [describe data distribution].
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
💡 Astuce : Pour choisir la méthode, testez d'abord la normalité (ex : test de Shapiro). Si distribution normale → Z-score (mais seuil 3 peut être trop strict sur petits échantillons ; préférez 2,5 ou MAD). Si asymétrique ou avec outliers nombreux → IQR (plus robuste). Pour données volumineuses ou non linéaires → Isolation Forest.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.