I have to connect and read data from 10 databases and save data as pandas data frame. After combining dataframes, I have an empty dataframe:
df1 = pd.DataFrame(columns={'name', 'ip'})
# in a loop I connect to db and read sql data and combine data
for db in database_list:
db_df = pd.read_sql_query(sql, con)
df1 = df1.append(db_df)
df1 = df1.drop_duplicates(subset='name', keep='last')
print df1
df1 is an empty dataframe. What is the correct way for combine dataframes in this situation?