All these three dataframes have same number of rows. While i do merge with concat function original dataframe get's deleted and it's only have car1 and car2 whenever i am adding car1,car2 to car dataframe all the contents get deleted and replace with car1,car2
car1=pd.get_dummies(car.company)
car2=pd.get_dummies(car.fuel_type)
car=pd.concat([car1, car2], axis=1)
print(car2.shape)
print(car1.shape)
print(car.shape) # original dataframe
o/p
(815, 3)
(815, 25)
(815, 6)
name company year Price kms_driven fuel_type
0 Hyundai Santro Xing XO eRLX Euro III Hyundai 2007 80,000 45,000 kms Petrol