I'm working on a Windows system with a 64-bit version of Python (Python 3.10.13, packaged by Anaconda, Inc.). When I run Python, the header indicates that it's a 64-bit environment: "Python 3.10.13 | packaged by Anaconda, Inc. | (main, Sep 11 2023, 13:24:38) [MSC v.1916 64 bit (AMD64)] on win32". I am not sure why it shows win32, since I have a win64 machine
I've verified the bitness through various methods. First using the following code, which correctly shows that I'm running a 64-bit Python environment.:
import platform
import sys
assert platform.architecture()[0] == "64bit"
assert sys.maxsize > 2**32
Next, I checked my conda version with conda info, which gives platform : win-64.
However, when I use Pandas (version 2.1.3) and create an empty Series with dtype=int:
import pandas as pd
print(pd.Series([1,2,3], dtype=int).dtype)
It shows 'int32' instead of 'int64'. I expected it to default to int64 in a 64-bit environment. If I do not specify int, like print(pd.Series([1,2,3]).dtype) it prints'int64'.
Why is Pandas defaulting to int32 instead of int64 in my 64-bit Python environment, and how can I ensure that it defaults to int64?
I do not want to explicitly convert all my DataFrames with .astype("int64"), since that could result in failing tests on other machines.