-2

I couldn't put the entire data frame as it looks clumsy, so I added data types.

DF1 Columns:

    Dependents            object
    ApplicantIncome        int64
    CoapplicantIncome    float64
    LoanAmount           float64
    Loan_Amount_Term     float64
    Credit_History       float64

DF2 Columns:

    Gender            int64
    Married           int64
    Education         int64
    Self_Employed     int64
    Credit_History    int64
    Property_Area     int64

My intention is to put two data frames side by side and make it a single data frame shape(480,12) but I'm getting more rows with repeated data entire column.

jain
  • 113
  • 2
  • 12

2 Answers2

1

I think that you are looking for something like DF1.join(DF2), but you should prepare an example of your inputs and the output you want. Also, you could use pd.concat([DF1, DF2], axis=1).

Angelo
  • 575
  • 3
  • 18
1

IIUC,

You need pandas concat and passing axis=1 which will make dataframes be joined side by side (vertically instead of horizontally). The code should be as follows:

final_df = pd.concat([df_1, df_2], axis=1)

Celius Stingher
  • 17,835
  • 6
  • 23
  • 53