TypeError:必须为实数,而不是MonthEnd

时间:2019-07-02 14:16:02

标签: python-3.x pandas

我有3个属性:

  • a = 2018-10(type =)
  • b = 2018-03(类型=)
  • c = 2(类型= int)

我想在下面计算一个答案(我希望答案是一个整数):

answer = math.floor((a - b) / c) 

然后我收到错误消息TypeError:必须是实数,而不是MonthEnd。我希望答案是一个整数,所以我尝试失败了:

answer = math.floor(int(a - b) / c) 

0 个答案:

没有答案