【发布时间】:2013-11-28 11:13:09
【问题描述】:
有人能解释一下这里发生了什么吗?
import numpy as np
test1 = ((154L, u'D2'), (155L, u'D2'), (156L, u'D2'))
print np.asarray(test1)
给予
[[u'15' u'D2']
[u'15' u'D2']
[u'15' u'D2']]
但有
test2 =((154L, u'SG2'), (155L, u'SG2'), (156L, u'SG1'))
print np.asarray(test2)
我们得到
[[u'154' u'SG2']
[u'155' u'SG2']
[u'156' u'SG1']]
test1 中的长整数发生了什么
【问题讨论】:
标签: python numpy type-conversion