For example: An example for what I'm expecting to get
In my real data, despite the fact that I connect two DFs with same row numbers, the new DF has more rows than the two I'm connecting.
df_numeric = df.iloc[:,0:10]
numeric_cols = df_numeric.columns.tolist()
df_categorial = df.iloc[:,10:]
from sklearn.preprocessing import Normalizer
transformer = Normalizer().fit(df_numeric) # fit does nothing.
df_numeric = transformer.transform(df_numeric)
df_numeric = pd.DataFrame(df_numeric)
df_numeric.columns = numeric_cols
df= pd.concat([df_numeric , df_categorial] , axis = 1 )
I get: my real DF after the concat
I tried What Vincent said :
df_numeric.reset_index(inplace=True, drop=True)
df_categorial.reset_index(inplace=True, drop=True)
df = pd.concat([df_numeric , df_categorial] , axis = 1 )
I think now it's working. I don't get why at the stat it made problem - before i rested the indexes they were the same in both DF