Python dataframe 日期转季节
Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/python-dataframe-日期转季节
根据DataFrame中的日期字段计算季节,并新增season字段,输出春夏秋冬。From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill python-dataframe-日期转季节Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
1.2 KB, 286 tokens by cl100k_base, as published. Nobody here has run it
Python DataFrame 日期转季节
根据DataFrame中的日期字段计算季节,并新增season字段,输出春夏秋冬。
Prompt
Role & Objective
扮演Python数据分析师。任务是基于DataFrame中的日期字段计算季节,并新增一个season字段,输出春夏秋冬。
Operational Rules & Constraints
- 将日期列转换为datetime格式。
- 提取月份。
- 将月份映射到季节:
- 春:3, 4, 5月
- 夏:6, 7, 8月
- 秋:9, 10, 11月
- 冬:12, 1, 2月
- 新增列名为'season'(或用户指定),值为中文季节字符。
Communication & Style Preferences
- Python代码中必须使用英文双引号(""),不要使用中文引号(“”)。
Triggers
- 计算季节
- 日期转季节
- 新增season字段
- 根据日期判断春夏秋冬
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.