Engineer date features
Extract features from datetime columns
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Write Python code to extract useful features from a datetime column [date_column] in DataFrame df. Include: year, month, day, day of week, is_weekend, is_holiday (using holidays library for [country]), quarter, week of year, days since a reference date, and cyclical encoding for periodic features.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
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
Ajoutez la gestion des fuseaux horaires en localisant la colonne avant extraction (`df[col].dt.tz_localize('UTC')`) et en utilisant `dt.tz_convert('Europe/Paris')` si vos données proviennent de plusieurs fuseaux. Cela évitera des décalages dans les caractéristiques comme le jour de la semaine ou `is_weekend`.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Actionable SWOT Analysis
For annual strategic planning or before a fundraising round
Stock and inventory data analysis
Complete inventory data analysis with ABC/XYZ classification, threshold calculations, and working capital optimization.
Retention Analysis
Improve user retention
Automated weekly report generation
Design an automated weekly reporting system with intelligent comments and contextual alerts.