擅长:python、mysql、java
<p>您需要以下内容:</p>
<pre><code>for i, row in staticData.iterrows():
unique_id = i
exchange = row['exchange']
</code></pre>
<p>我将是索引标签值</p>
<p>示例:</p>
<pre><code>In [57]:
df = pd.DataFrame(np.random.randn(5,3), index=list('abcde'), columns=list('fgh'))
df
Out[57]:
f g h
a -0.900835 -0.913989 -0.624536
b -0.854091 0.286364 -0.869539
c 1.090133 -0.771667 1.258372
d -0.721753 -0.329211 0.479295
e 0.520786 0.273722 0.824172
In [62]:
for i, row in df.iterrows():
print('index: ', i, 'col g:', row['g'])
index: a col g: -0.913988608754
index: b col g: 0.286363847188
index: c col g: -0.771666520074
index: d col g: -0.329211394286
index: e col g: 0.273721527592
</code></pre>