Prandrou 2022-03-26 01:00 采纳率: 100%
浏览 416
已结题

使用math.exp报错 cannot convert the series to <class 'float'>

R = result['R'].astype(float)
RMAX = result['Time']
Yuce = math.exp(-((R + RMAX) / RMAX))

运行结果及报错内容

TypeError: cannot convert the series to <class 'float'>

  • 写回答

1条回答 默认 最新

  • hellobigorange 人工智能领域新星创作者 2022-03-26 09:35
    关注

    math.exp的参数只能是float,不可以是series

    用np.exp就可以了

    import numpy as np
    Yuce = np.exp(-((R + RMAX) / RMAX))
    
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 4月4日
  • 已采纳回答 3月27日
  • 创建了问题 3月26日