How do I get conversion with "OverflowError: Python int too large to convert to C long" error working on Windows Server 2012?
<p>When running this on Anaconda Python 2.7.12, Pandas 18.1, Windows Server 2012:</p>

<pre><code>df['z'] = df['y'].str.replace(' ', '').astype(int)
</code></pre>

<p>I get this error:</p>

<pre><code>OverflowError: Python int too large to convert to C long
</code></pre>

<p>I do not get this error on MacOS 10.11 or Ubuntu 14.04.  I read from somewhere else that the Windows C++ compiler has a different definition of long than a Unix-like OS.  If so, how do I make this work on Windows?</p>

<p>Additionally, data.txt is only 172 KB in size.  If it helps, data.txt takes this form:</p>

<pre><code>x|y
99999917|099999927 9991
99999911|999999979 9994
99999912|999999902 9992
</code></pre>

<p><code>int</code> is interpreted by numpy by as the <code>np.int_</code> dtype, which corresponds to a C integer.  On Windows, even on a 64 bit system, this is a 32 bit integer. </p>

<p>So if you need to cast larger values, specify a 64 bit integer using</p>

<pre><code>.astype('int64')
</code></pre>

python c++ pandas numpy anaconda