P
📊Analyse de donnéesBeginnerAll AIs

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

Extract features from datetime columns

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • 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

361
📊Analyse de donnéesIntermediateAll AIs

Stock and inventory data analysis

Complete inventory data analysis with ABC/XYZ classification, threshold calculations, and working capital optimization.

663
📊Analyse de donnéesIntermediateAll AIs

Retention Analysis

Improve user retention

333
📊Analyse de donnéesIntermediateAll AIs

Automated weekly report generation

Design an automated weekly reporting system with intelligent comments and contextual alerts.

548