当前位置:网站首页>Valueerror: invalid literal for int() with base 10 conversion error related to data type
Valueerror: invalid literal for int() with base 10 conversion error related to data type
2022-04-23 20:47:00 【NuerNuer】
1.ValueError: invalid literal for int() with base 10
a Is a string , for example ‘108.8’
Error reason : Direct pair a Conduct int(a) operation , Grammar does not allow
terms of settlement :int(float(a)) or round(float(a)), That is, first convert the string to floating-point data , Then round
2.TypeError: Cannot cast array data from dtype(‘float64‘) to dtype(‘<U32‘)....
Error reason :‘U32’ and ’S32’ All means numpy An array is an array of strings , Not an array of numbers , Therefore, it cannot be directly converted to floating-point array , Be careful ,numpy Array , As long as one item is a string , The types returned by the array are all string arrays .
terms of settlement : take numpy Convert to floating point array , Reference code :
mx = mx.astype(float)
版权声明
本文为[NuerNuer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210545523170.html
边栏推荐
- Go limit depth traversal of files in directory
- 深入探究ASP.NET Core读取Request.Body的正确方式
- Introduction to standardization, regularization and normalization
- Linux中,MySQL的常用命令
- DOS command of Intranet penetration
- BMP JPEG picture to vector image contourtrace
- UnhandledPromiseRejectionwarning:CastError: Cast to ObjectId failed for value
- Create vs project with MATLAB
- Mysql database common sense storage engine
- Easy to use nprogress progress bar
猜你喜欢
Come in and teach you how to solve the problem of port occupation
C migration project record: modify namespace and folder name
Case of the third day of go language development fresh every day project - news release system II
Unity Odin ProgressBar add value column
JS arrow function user and processing method of converting arrow function into ordinary function
How to configure SSH public key in code cloud
电脑越用越慢怎么办?文件误删除恢复方法
居家第二十三天的午饭
一些接地气的话儿
Common problems in deploying projects with laravel and composer for PHP
随机推荐
The more you use the computer, the slower it will be? Recovery method of file accidental deletion
go interface
100天拿下11K,转岗测试的超全学习指南
Bracket matching -- [implementation of one-dimensional array]
Vulnhub DC: 1 penetration notes
An error occurs when the addressable assets system project is packaged. Runtimedata is null
电脑越用越慢怎么办?文件误删除恢复方法
Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
Async function ------ ES6
41. The first missing positive number
On IRP from the perspective of source code
LeetCode 20、有效的括号
Leetcode 1346. Check whether integers and their multiples exist
Selenium 显示等待WebDriverWait
JSX syntax rules
[PTA] l1-006 continuity factor
Vscode download speed up
Addition, deletion, modification and query of MySQL advanced table
Parsing methods of JSON data in C - jar and jobobject: error reading jar from jsonreader Current JsonReader item
laravel 发送邮件