code: def merge_bundles(zsource, ztarget):
      """
      Merge
      Parameters
      ----------
      zsource
      ztarget
  
      Returns
      -------
  
      """
      # TODO: find a way to do this iteratively instead of in-memory
      df_source = zsource.todataframe()
      df_target = ztarget.todataframe()
  
      df = pd.concat(
          [df_source, df_target], ignore_index=True
      )  # type: pd.DataFrame
      df.drop_duplicates(inplace=True)
      df.set_index(["date", "symbol"], drop=False, inplace=True)
  
      sanitize_df(df)
  
      dirname = os.path.basename(ztarget.rootdir)
      bak_dir = ztarget.rootdir.replace(dirname, ".{}".format(dirname))
      shutil.move(ztarget.rootdir, bak_dir)
  
      z = bcolz.ctable.fromdataframe(df=df, rootdir=ztarget.rootdir)
      shutil.rmtree(bak_dir)
      return z
  
file_path: catalyst/catalyst/marketplace/utils/bundle_utils.py
imports: import os
  import random
  import re
  import shutil
  import bcolz
  import numpy
  import pandas
  from six import string_types
label_desc: Use image node_id 1 for calling a global function with example usage: merge_bundles(zsource, ztarget) and returns: z