Matrice转换为pandas datafame

时间:2018-06-12 15:24:16

标签: pandas dataframe

当我想在pd.dataframe中转换此类输入时,我遇到了一些问题。此数组是使用Beautifulsoup的原始html内容的先前数据集合的结果。当我试图用pandas.DataFrame函数转换这个双数组时,我有一个空洞和好奇的结果。

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0xb000000000014153'
*** First throw call stack:
(0x18485cf48 0x19940ff80 0x184863c5c 0x184860c00 0x184764cac 0x18482c978 0x18476de38 0x18460f134 0x1845ebda0 0x1845ed47c 0x18453f2fc 0x184509f04 0x1845d0fdc 0x1845d8fd8 0x1025b5c68 0x1025c181c 0x1845cb830 0x184509ab0 0x18452e1d8 0x1005bce00 0x10029e498 0x100484a08 0x1003c097c 0x1003ca13c 0x1001296e8 0x1025b5ca8 0x1025b5c68 0x1025bb710 0x1848141f8 0x184812060 0x184740ca0 0x18f97c088 0x189e58ffc 0x10011c8e0 0x199c5e8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

请看下面我的输出:

data=[['h1', '\n        An Example of Structure\n        '],
['p', "\n        Here's a typical paragraph.\n      "],
['ul', '\n'],
['li', '\n          Item one has an\n          '],
['a', '\n            anchor\n          '],
['h1', '\n        An Example of Structure\n        '],
['p', "\n        Here's a typical paragraph.\n      "],
['ul', '\n'],
['li', '\n          Item one has an\n          '],
['h1', '\n        An Example of Structure\n        '],
['p', "\n        Here's a typical paragraph.\n      "],
['ul', '\n'],
['li', '\n          Item one has an\n          '],
['a', '\n            anchor\n          ']]

0 个答案:

没有答案