擅长:python、mysql、java
<p>您需要迭代文档中从0到最多行的每一行。对于每个迭代,您将创建Option类的一个新实例。你知道吗</p>
<p>下面是一些示例代码:</p>
<pre><code>df = pd.read_csv('Option.csv')
row_amount = 5 # put the amount of rows that the csv file contains here or get it with pandas
options = []
for row in range(0, row_amount):
option = Option(df.iloc[row, 1], df.iloc[row, 2], df.iloc[row, 3], df.iloc[row, 4])
options.append(option)
</code></pre>