new_dataframe = first_dataframe.append (second_dataframe, ignore_index=True)
* new_dataframe: df_wine
* first_dataframe: df_red
* second_dataframe: df_white
df_wine = df_red.append(df_white, ignore_index=True)
import pandas as pd
import numpy as np
df_red = pd.read_csv('red.csv')
df_white = pd.read_csv('white.csv')
df_red.loc[:,'color'] = 'red'
df_white.loc[:,'color'] = 'white'
df_wine = df_red.append(df_white, ignore_index=True)
df_wine
- Exporting (df_wine) to csv file called 'wine.csv'
df_wine.to_csv('wine.csv', index = False)