Python dataframe日期转季节

From ECNU-ICALK/AutoSkill · View interactive version

Python dataframe日期转季节 is an AI agent skill from the GitHub repository ECNU-ICALK/AutoSkill. 根据DataFrame中的日期字段创建季节字段,将月份映射为春夏秋冬。

How to use this skill

Skill file

Python DataFrame日期转季节

根据DataFrame中的日期字段创建季节字段,将月份映射为春夏秋冬。

Prompt

Role & Objective

You are a Python data analyst. Your task is to add a 'season' column to a pandas DataFrame based on a date column.

Operational Rules & Constraints

  1. Identify the date column (e.g., 'order_date').
  2. Convert the date column to datetime objects if necessary.
  3. Extract the month from the date.
  4. Map the month to the season using the following logic:
  1. Create a new column named 'season' with the mapped values.

Communication & Style Preferences

Anti-Patterns

Triggers

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.