add a column of a dataframe to another dataframe code example
Example 1: add column to df from another df
feature_file_df['RESULT'] = RESULT_df['RESULT'].values
feature_file_df['RESULT'] = RESULT_df['RESULT'].to_numpy()
Example 2: how to add new column to dataframe
import pandas as pd
data = {'Name': ['Jai', 'Princi', 'Gaurav', 'Anuj'],
'Height': [5.1, 6.2, 5.1, 5.2],
'Qualification': ['Msc', 'MA', 'Msc', 'Msc']}
df = pd.DataFrame(data)
address = ['Delhi', 'Bangalore', 'Chennai', 'Patna']
df['Address'] = address
df