为了账号安全,请及时绑定邮箱和手机立即绑定

python怎么将numpy类转为string类

python怎么将numpy类转为string类

HUH函数 2019-03-22 11:15:17
python怎么将numpy类转为string类
查看完整描述

2 回答

?
饮歌长啸

TA贡献1951条经验 获得超3个赞

# -*- coding:utf-8 -*-

import numpy as np

mystr = "100110"

print np.array(list(mystr)

print np.array(list(mystr)).tostring()



查看完整回答
反对 回复 2019-03-24
?
慕桂英4014372

TA贡献1871条经验 获得超13个赞


1

2

3

4

5

6

7

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]'

 


查看完整回答
反对 回复 2019-03-24
  • 2 回答
  • 0 关注
  • 7542 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信