IndexingError: Unalignable boolean Series key provided in linux
<p>I have a pandas DataFrame and I would like to drop some columns based on the values of their mean. For eaxmple I have:</p>

<pre><code>column 1  column 2   column 3
      1          1          3
      1          2          3
      2          1          4
</code></pre>

<p>I used <a href="https://stackoverflow.com/questions/33851209/excluding-columns-from-a-dataframe-based-on-their-mean-without-using-a-loop/33852204?noredirect=1#comment55512758_33852204">This solution</a> which works fine on windows. For example, from the dataFrame df, i would like to drop columns that have a mean greater than 2.5 I wrote:</p>

<pre><code>m=df.mean(axis=0)
df.loc[:,m&lt;=2.5]
</code></pre>

<p>That works perfectly on Windows as the column 3 is dropped. But when I try it in linux, I have the following error:</p>

<pre><code>IndexingError: Unalignable boolean Series key provided .
</code></pre>

<p>What could be the problem?</p>