Skip to content

Instantly share code, notes, and snippets.

@usmcamp0811
Created October 1, 2018 17:34
Show Gist options
  • Save usmcamp0811/bc1c142d8a1ae2a66b14455579bf868a to your computer and use it in GitHub Desktop.
Save usmcamp0811/bc1c142d8a1ae2a66b14455579bf868a to your computer and use it in GitHub Desktop.
concat two or more ctables along the 0 axis.
def ctable_append(cts):
"""
A function to append multiple ctables and clean up the disk entries along the 0 axis
similar to pd.concat([df1, df2], axis=0)
:param cts: a string containing the root directory path or a list of ctables
:return: ctable
"""
import shutil
ctables = []
first = True
# check if we are getting a list or a root dir
if type(cts) == str:
cts = bcolz.walk(cts)
for ct in cts:
if first is True:
ct1 = ct
else:
ct1.append(ct)
shutil.rmtree(ct.rootdir)
first = False
return ct1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment