Python & Pandas - pd.Series difference between int32 and int64

Viewed 9062

I'm starting to learn python, numpy and panda's and I have a really basic question, about sizes.

Please see the next code blocks:

1. Length: 6, dtype: int64

# create a Series from a dict
pd.Series({key: value for key, value in zip('abcdef', range(6))})

vs.

2. Length: 6, dtype: int32

# but why does this generate a smaller integer size???
pd.Series(range(6), index=list('abcdef'))

Question So I think when you put a list, numpy array, dictionary etc. in the pd.Series you will get int64 but when you put just the range(6) in the pd.Series you will get int32. Can someone please make this a little bit clear to me?

Sorry for the very basic question.

@Edit : I'm using Pandas version 0.20.1 and Numpy 1.12.1

1 Answers
Related