【发布时间】:2018-04-24 09:48:01
【问题描述】:
如何转移
A = [0.12075357905088335, -0.192198145631724, 0.9455373400335009, -0.6811922263715244, 0.7683786941009969, 0.033112227984689206, -0.3812622359989405]
到
A = [[0.12075357905088335], [-0.192198145631724], [0.9455373400335009], [-0.6811922263715244], [0.7683786941009969], [0.033112227984689206], [-0.3812622359989405]]
我尝试了下面的代码,但发生了错误:
new = []
for i in A:
new.append.list(i)
TypeError: 'float' object is not iterable
谁能帮帮我?
【问题讨论】:
-
请您粘贴您在问题中使用的实际代码吗?您粘贴的代码给出了
AttributeError: 'builtin_function_or_method' object has no attribute 'list',它没有给出TypeError。
标签: python python-3.x