{TypeError}can’t multiply sequence by non-int of type ‘numpy.float64’
Multiplying float64 and tuples raises an error
a=(2,4,6)
b=35.6
c=a*b
The reason is that a is of int type and B is of float type, and the types are inconsistent, so the multiplication operation cannot be performed
The solution is to change the data type to consistent.
a=(2,4,6)
b=35
c=a*b
print(c)
Read More:
- [Solved] Pytorch Tensor to numpy error: RuntimeError: Can‘t call numpy() on Tensor that requires grad.报错
- [Solved] Pytorch Error: RuntimeError: expected scalar type Double but found Float
- To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe.
- [Solved] Runtime error: expected scalar type Float but found Double
- Flask Database Migration Error: ERROR [flask_migrate] Error: Can‘t locate revision identified by ‘a1c25fe0fc0e‘
- Pytorch Error: runtimeerror: expected scalar type double but found float
- Python: RNN principle realized by numpy
- [Solved] RuntimeError: expected scalar type Long but found Float
- [Solved] flask db migrate execute error: ERROR [flask_migrate] Error: Can‘t locate revision identified by ‘8d1ad59dc71a‘
- Pytorch Error: RuntimeError: value cannot be converted to type float without overflow: (0.00655336,-0.00
- For the problem of rejecting old usage errors after numpy is updated, modified in numpy 1.20; for more details and guidance
- Python: LeetCode 43 Multiply Strings
- SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 2-3: truncated \UX
- [Solved] git review Error: UnicodeDecodeError: ‘gbk‘ codec can‘t decode
- [Solved] UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xbf in position 7: invalid start byte
- [Solved] SyntaxError: (unicode error) ‘unicodeescape‘ codec can‘t decode bytes in position 10-11: malformed
- AttributeError: can‘t set attribute [How to Solve]
- How to Solve Pytorch DataLoader Loading Error: UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe5 in position 1023
- [Solved] Can‘t pickle local object ‘_createenviron.<locals>.encodekey‘
- [Solved] YOLO v5 Error: AttributeError: Can‘t get attribute SPPF on module models