-2
我收到以下错误:在这行代码TypeError: list indices must be integers, not str
:从DB转换海峡到整数
a= doc['coordinates']['coordinates']
这是阅读的记录,我想知道如何将它转换成来自海峡整数?
感谢
编辑:
doc['coordinates']['coordinates']
回报协调从MongoDB中,在这些领域的信息。它返回程序运行的前十次的相关信息,然后我得到这个错误。
是'coordinates'变量中你存储记录值? –
坐标是我存储经度和纬度信息的字段 – user94628
看起来像'doc ['coordinates']'正在返回一个列表。 –