【发布时间】:2017-09-30 22:49:01
【问题描述】:
我有以下 numpy 数组:
arr= [[ 0. 0.1046225518 0. 0.8953774482 0. ]]
暂时我有
values= str(np.around([arr*100],decimals=2))
返回:
[[ 0. 10.46 0. 89.53 0. ]]
如果我 + % 到值,它会返回
[[ 0. 10.46 0. 89.53 0. ]]%
想要的输出是:
[[ 0. 10.46% 0. 89.53% 0. ]]
【问题讨论】:
-
你的输出应该是什么?一个 numpy 字符串数组,还是只是一个字符串?
-
numpy 字符串数组,因为之后想转向数据框