小编Kha*_*far的帖子

如何将 (np.busday_count) 与 pandas.core.series.Series 一起使用

我想计算两列类型之间的工作日 pandas.core.series.Series

接收日期完成日期# 个工作日
之间 ,我试图使用 np.busday_count(Received date,complete date,weekmask= "Fri Sat") 但我得到:

TypeError: 迭代器操作数 0 dtype 无法根据规则 'safe' 从 dtype('M8[us]') 转换为 dtype('M8[D]')

这是我的数据框的一部分:

     Received   Complete
0  2018-09-10 2018-09-25
1  2018-07-16 2018-08-13
2  2018-07-05 2018-07-11
3  2018-07-05 2018-07-23
4  2018-07-26 2018-08-14
5  2018-07-04 2018-08-28
6  2018-07-05 2018-07-10
7  2018-07-05 2018-07-10
8  2018-07-05 2018-07-22
9  2018-07-05 2018-07-22
10 2018-07-05 2018-07-19
Run Code Online (Sandbox Code Playgroud)

python datetime numpy python-3.x pandas

5
推荐指数
1
解决办法
8273
查看次数

标签 统计

datetime ×1

numpy ×1

pandas ×1

python ×1

python-3.x ×1