row='1,2,3.0,nan'
#字符串转数组,并去除特殊符号,去掉.0转为格式上的整数
list(row.replace('nan','0').replace('.0','').split(','))
['1', '2', '3','0']
#将格式上的整数,转换为类型上的整数
list(map(int,list(row.replace('nan','0').replace('.0','').split(',')) ))
[1, 2, 3,0]
方法:
list(map(int,str_list))
python 字符串转char* python 字符串转数组
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Java 前后端登录密码加密传输
引言在日常开发中我们对HTTP数据传输并不陌生,前端需要与后端进行数据交互往往需要调用后端某个API,然而在前端与后端的请求过程中数据真的安全吗?下面了解一件关于0.01购买phone事件;事件在之前报导一个新闻,某个电商APP应用因为程序Bug,被灰色产业0.01元撸走千台iPhone手机,损失近千万,后来了解到也并非高手所为,其实就是该APP在购买接口中对数据传输缺少安全防范,通过HTTP抓包
android des ecb加密 java base64解密 java des加密 java des加密解密