擅长:python、mysql、java
<blockquote>
<p><code>[u'0.38310000', u'1564.04672409']</code></p>
<p>Looks like you are dealing with a <code>list</code> as you can see it is in <code>[]</code>
brackets with comma delimited items. Lists are 0-index based, meaning
0 is the position of the first element.</p>
</blockquote>
<p><code>c[0]</code>只会得到第一个数字。你知道吗</p>
<p>然后要转换为float,请使用<code>float()</code></p>
<pre><code>... code
some_string = c[0]
some_float = float(some_string)
</code></pre>
<p>或者,简单地说,假设你的回答中至少有一个元素:</p>
<pre><code>first_num = float(parsed["result"]["XXRPZEUR"]["c"][0])
</code></pre>
<p><strong>编辑:</strong></p>
<p>我将保留答案,但我想我最初误解了你的问题,你需要所有的结果(不仅仅是第一个)作为浮动。你知道吗</p>
<p>在本例中,使用<code>map()</code>将列表中的所有元素转换为float(根据@LeKhan9的答案,他在我之前发布了<code>map()</code>解决方案)。你知道吗</p>
<pre><code>c = parsed["result"]["XXRPZEUR"]["c"]
result = map(float, c)
</code></pre>