将多个月的缩写转换为整数
给定以下列:
col
0 NaN
1 Jan,Apr,Jul,Oct
2 Jan,Jun,Jul
3 Apr,May,Oct,Nov
4 NaN
...
如何将月份缩写转换为月号(INT)?并用连字符代替tghe逗号?输出应该看起来像:
col
0 NaN
1 01-04-07-10
2 01-06-07
3 04-05-10-11
4 NaN
...
Given the below column:
col
0 NaN
1 Jan,Apr,Jul,Oct
2 Jan,Jun,Jul
3 Apr,May,Oct,Nov
4 NaN
...
How to convert the months abbreviation to month number (int)? and replace tghe comma with a hyphen? The output should look like:
col
0 NaN
1 01-04-07-10
2 01-06-07
3 04-05-10-11
4 NaN
...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 使用数月的字典,如果添加了
,
以替换为-
:Use
Series.replace
with dictionary with months and if necesary is added,
for replace to-
: