我有下面的数据帧
df = pd.DataFrame({'Start_Date': ['2018-08-23', '2018-08-16', '2018-08-24', '2018-08-29'], 'Days': ['3', '1', '3', '0']})
我想创建一个新的列“结束日期”。结束日期将是开始日期+天。此外,结束日期应仅为工作日(不包括周末)。你知道吗
预计出局
Start Date Days End_Date
2018-08-23 3 2018-08-28
2018-08-16 1 2018-08-17
2018-08-24 3 2018-08-29
2018-08-29 0 2018-08-29
我试过使用来自omz的解决方案,但它对我不起作用。我试过使用workday函数,但也不起作用。你知道吗
你知道吗?你知道吗
可以这样使用BDay:
输出:
您可以使用
numpy.busday_offset
获得下一个工作日。你知道吗相关问题 更多 >
编程相关推荐