Problem
I have concatenated two series of type int and the dataframe I get in return is of type float. This happens because the indices of the series are not aligned and when concatenation happens, pandas fills the gaps with NaN. However, NaN is considered a float and unfortunately converts all my ints into floats along with it.
Question
My question is, how can I fill the gaps with something else that won't convert my ints to floats?
MCV
import pandas as pd
s1 = pd.Series([1], index=['A'])
s2 = pd.Series([1], index=['B'])
print "s1 type: {} | s2 type: {}\n".format(s1.dtype, s2.dtype)
df = pd.concat([s1, s2], axis=1)
print df, "\n"
print df.dtypes
Prints:
s1 type: int64 | s2 type: int64
0 1
A 1.0 NaN
B NaN 1.0
0 float64
1 float64
dtype: object