擅长:python、mysql、java
<p>将<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.set_index.html" rel="nofollow noreferrer">^{<cd1>}</a>与<a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_dict.html" rel="nofollow noreferrer">^{<cd2>}</a>一起使用,参数<code>orient='dict'</code>默认为,因此省略:</p>
<pre><code>d = df.set_index('ScID.xml').to_dict()
print (d)
{'topic1': {'0006-****(****)050[****:ayfb]2.3.co.xml': 7.26744186046513e-06,
'0006-****(****)050[****:smihds]2.3.co.xml': 0.0006479109,
'0006-****(****)050[****:gissad]2.3.co.xml': 3.413e-06},
'topic2': {'0006-****(****)050[****:ayfb]2.3.co.xml': 7.26744186046513e-06,
'0006-****(****)050[****:smihds]2.3.co.xml': 0.0091339857,
'0006-****(****)050[****:gissad]2.3.co.xml': 3.413e-06},
'topic3': {'0006-****(****)050[****:ayfb]2.3.co.xml': 7.26744186046513e-06,
'0006-****(****)050[****:smihds]2.3.co.xml': 2.79485746226941e-06,
'0006-****(****)050[****:gissad]2.3.co.xml': 3.413e-06}}
</code></pre>