<p>我有一个从卡格尔的旧金山薪水中提取出来的数据框:<a href="https://www.kaggle.com/kaggle/sf-salaries" rel="noreferrer">https://www.kaggle.com/kaggle/sf-salaries</a>
我希望创建一组列的值,例如“Status”。</p>
<p>这是我尝试过的,但是它带来了一个所有记录的列表,而不是集合(sf是我命名数据帧的方式)。</p>
<pre><code>a=set(sf['Status'])
print a
</code></pre>
<p>根据这个网页,这应该行得通。
<a href="https://stackoverflow.com/questions/15768757/how-to-construct-a-set-out-of-list-items">How to construct a set out of list items in python?</a></p>