recarray
具有field()
方法,可用于此目的。使用您的示例...
>>> x.field(2)
... array(['0 bottles of beer on the wall', '1 bottles of beer on the wall',
'2 bottles of beer on the wall', '3 bottles of beer on the wall',
'4 bottles of beer on the wall', '5 bottles of beer on the wall',
'6 bottles of beer on the wall', '7 bottles of beer on the wall',
'8 bottles of beer on the wall', '9 bottles of beer on the wall',
'10 bottles of beer on the wall', '11 bottles of beer on the wall',
'12 bottles of beer on the wall', '13 bottles of beer on the wall',
'14 bottles of beer on the wall', '15 bottles of beer on the wall',
'16 bottles of beer on the wall', '17 bottles of beer on the wall',
'18 bottles of beer on the wall', '19 bottles of beer on the wall'], dtype=object)
numpy.recarray
转换为pandas.DataFrame
。 - Jason S