发布网友 发布时间:2022-04-24 00:33
共5个回答
热心网友 时间:2022-04-18 05:21
# -*- coding:utf-8 -*-
import numpy as np
mystr = "100110"
print np.array(list(mystr)
print np.array(list(mystr)).tostring()
参考资料
python怎么将numpy类转为string类?.百度知道[引用时间2018-1-13]
热心网友 时间:2022-04-18 06:39
.tostring() 进行转换
示例代码:
热心网友 时间:2022-04-18 08:14
Python 3.6.1 (default, Mar 22 2017, 06:17:05)
[GCC 6.3.0 20170321] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> a = np.arange(10)
>>> str(a)
'[0 1 2 3 4 5 6 7 8 9]'
热心网友 时间:2022-04-18 10:05
.tostring() 进行转换
示例代码:
1
2
3
4
5
# -*- coding:utf-8 -*-
import numpy as np
mystr = "100110"
print np.array(list(mystr))
print np.array(list(mystr)).tostring()
热心网友 时间:2022-04-18 12:13
你这是要干嘛哈