List = ['Stevie', '$101', '(33%)', 'Hezazeb', '$3.60', '(85%)',
'Boga Dreams', '$5.50', '(25%)', 'Grey Detective', '$8.00', '(22%)',
'Bring A Dame', '$26.00', '(8%)', 'Sandhill', '$5.00', '(100%)',
'Burgundy Rules', '$41.00', '(17%).', 'Luxitorah', '$7.50', '(0%)',
'Play On Words', '$21.00', '(14%).', 'Cranky Sheriff', '$13.00', '(8%)']
我希望此列表以以下方式存储在具有3列的数据框中。我正在从网站获取此数据,因此无法手动执行此操作
- Playername Bids probability
- Stevie. $101. 33%
- Hezazeb. $3.60. 85%
- .
- .
- .
等等
要将列表转换为数据帧,您应该有tuples或pd.series或任何数据帧对象,在您的情况下,我建议手动将它们转换为dict,因为每个点的数据都非常不同,然后用nan填充缺少的列
这甚至适用于非固定数据-您只需预处理:
输出:
如果您不清楚,请参阅Understanding slice notation
相关问题 更多 >
编程相关推荐