<h4 dir="auto">code below is scene that issue happened.</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" for user_id, row in pending_data_df.iterrows():

        df = DataFrame(
            columns=[
                Names.call.same_call_counts,
                Names.call.phonebook_detail
            ],
            index=[user_id]
        )

        phoneBookPath = row[Names.app.phonebookpath]
        call_number_list = row.get(Names.call.call_number_list)"><pre class="notranslate"> <span class="pl-k">for</span> <span class="pl-s1">user_id</span>, <span class="pl-s1">row</span> <span class="pl-c1">in</span> <span class="pl-s1">pending_data_df</span>.<span class="pl-en">iterrows</span>():

        <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-v">DataFrame</span>(
            <span class="pl-s1">columns</span><span class="pl-c1">=</span>[
                <span class="pl-v">Names</span>.<span class="pl-s1">call</span>.<span class="pl-s1">same_call_counts</span>,
                <span class="pl-v">Names</span>.<span class="pl-s1">call</span>.<span class="pl-s1">phonebook_detail</span>
            ],
            <span class="pl-s1">index</span><span class="pl-c1">=</span>[<span class="pl-s1">user_id</span>]
        )

        <span class="pl-s1">phoneBookPath</span> <span class="pl-c1">=</span> <span class="pl-s1">row</span>[<span class="pl-v">Names</span>.<span class="pl-s1">app</span>.<span class="pl-s1">phonebookpath</span>]
        <span class="pl-s1">call_number_list</span> <span class="pl-c1">=</span> <span class="pl-s1">row</span>.<span class="pl-en">get</span>(<span class="pl-v">Names</span>.<span class="pl-s1">call</span>.<span class="pl-s1">call_number_list</span>)</pre></div>
<h4 dir="auto">Problem description</h4>
<h4 dir="auto">when I wanted to get a set from a Series , it happended.</h4>
<h4 dir="auto">it has worked well for a long time,but suddenly it broke out. raise Traceback like this:</h4>
<p dir="auto">Traceback (most recent call last):<br>
File "/usr/local/lib/python3.5/threading.py", line 914, in _bootstrap_inner<br>
self.run()<br>
File "/home/datascience/zh/suijiesuihuan/datascience/my_threads.py", line 87, in run<br>
ret_data, result = make_decision(int(self.layerId), df_input)<br>
File "/home/datascience/zh/suijiesuihuan/datascience/layered_decision.py", line 52, in make_decision<br>
data_df, result_df = load_features_group_loader(features_group_loader_id, mocking)(data_df)<br>
File "/home/datascience/zh/suijiesuihuan/datascience/dynamic_content_loader.py", line 166, in inner<br>
return load_and_make_decision(data_df, config_new)<br>
File "/home/datascience/zh/suijiesuihuan/datascience/dynamic_content_loader.py", line 111, in load_and_make_decision<br>
new_feature_group_df, error_df = _load_data(pending_df, features_loader_id, features_loader, mocking)<br>
File "/home/datascience/zh/suijiesuihuan/datascience/dynamic_content_loader.py", line 76, in _load_data<br>
data_df, result_df = features_loader(data_df)<br>
File "/home/datascience/zh/suijiesuihuan/dynamic_contents/feature_group_loader/feature_group_loader_0003/feature_group_loader.py", line 55, in load<br>
call_number_list = row.get(Names.call.call_number_list)<br>
File "/home/datascience/zh/venv/lib/python3.5/site-packages/pandas/core/generic.py", line 1633, in get<br>
return self[key]<br>
File "/home/datascience/zh/venv/lib/python3.5/site-packages/pandas/core/series.py", line 611, in <strong>getitem</strong><br>
dtype=self.dtype).<strong>finalize</strong>(self)<br>
File "/home/datascience/zh/venv/lib/python3.5/site-packages/pandas/core/series.py", line 227, in <strong>init</strong><br>
"".format(data.<strong>class</strong>.<strong>name</strong>))<br>
TypeError: 'set' type is unordered</p>
<h4 dir="auto">someone knows what happened?</h4>
<p dir="auto">this fails because we are putmasking on a  dtype=int ndarray<br>
need to cast if this is the case (in series.where)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import pandas
df = pandas.DataFrame(index=[1,2])
df['test'] = [1,2]
df['test'][[True, False]] = pandas.Series([0],index=[1])

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-9-7738933c68bb&gt; in &lt;module&gt;()
----&gt; 1 df['test'][[True,False]] = pandas.Series([0],index=[1])

/mnt/home/jreback/pandas/pandas/core/series.pyc in __setitem__(self, key, value)
    677         if _is_bool_indexer(key):
    678             key = self._check_bool_indexer(key)
--&gt; 679             self.where(~key,value,inplace=True)
    680         else:
    681             self._set_with(key, value)

/mnt/home/jreback/pandas/pandas/core/series.pyc in where(self, cond, other, inplace)
    630             raise ValueError('Length of replacements must equal series length')
    631 
--&gt; 632         np.putmask(ser, ~cond, other)
    633 
    634         return None if inplace else ser

TypeError: array cannot be safely cast to required type
"><pre class="notranslate"><code class="notranslate">import pandas
df = pandas.DataFrame(index=[1,2])
df['test'] = [1,2]
df['test'][[True, False]] = pandas.Series([0],index=[1])

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
&lt;ipython-input-9-7738933c68bb&gt; in &lt;module&gt;()
----&gt; 1 df['test'][[True,False]] = pandas.Series([0],index=[1])

/mnt/home/jreback/pandas/pandas/core/series.pyc in __setitem__(self, key, value)
    677         if _is_bool_indexer(key):
    678             key = self._check_bool_indexer(key)
--&gt; 679             self.where(~key,value,inplace=True)
    680         else:
    681             self._set_with(key, value)

/mnt/home/jreback/pandas/pandas/core/series.pyc in where(self, cond, other, inplace)
    630             raise ValueError('Length of replacements must equal series length')
    631 
--&gt; 632         np.putmask(ser, ~cond, other)
    633 
    634         return None if inplace else ser

TypeError: array cannot be safely cast to required type

</code></pre></div>