RuntimeError: result type Float can't be cast to the desired output type __int64
时间: 2023-09-23 16:07:08 浏览: 168
Python RuntimeError: thread.__init__() not called解决方法
This error occurs when you try to convert a floating-point number to an integer value using the __int64 data type. The __int64 data type is used for 64-bit integer values, while float data type is used for decimal values.
To fix this error, you should convert the floating-point number to an integer value using the int() function instead of the __int64 data type. For example:
```python
x = 3.14
y = int(x)
print(y)
```
In this example, the float value 3.14 is converted to an integer value using the int() function, and the output will be 3.
阅读全文