effective_pandas_book icon indicating copy to clipboard operation
effective_pandas_book copied to clipboard

[Question - Chapter 4] dtype='int64' is not np.int64

Open AlessandroMiola opened this issue 2 years ago • 0 comments

Hi Matt! First off, thank you for your amazing book! :) I'm going through Chapter 4. I totally understand the discussion behind the nullable integer type. Instead, I'm wondering why this sentence from Pandas documentation on Nullable Integer data type

Or the string alias "Int64" (note the capital "I", to differentiate from NumPy’s 'int64' dtype)

does not find confirmation in the following (songs2.dtype is np.int64 gives False):

songs2 = pd.Series(
    [145, 142, 133, 19],
    name='counts'
)

print(songs2.dtype is np.int64)

What am I missing and misunderstanding?

Thank you for your help!

AlessandroMiola avatar Oct 02 '22 14:10 AlessandroMiola