Skip to content

Instantly share code, notes, and snippets.

@kaykurokawa
Created May 21, 2024 16:28
Show Gist options
  • Save kaykurokawa/e399c301a2c087f66739f463126f474f to your computer and use it in GitHub Desktop.
Save kaykurokawa/e399c301a2c087f66739f463126f474f to your computer and use it in GitHub Desktop.
class ColArrayReader:
def __init__(self, columns, array):
""" a simple reader that wraps column names and array in a reader """
if not isinstance(columns, cppmft.NSCols):
cb = cppmft.ColBuilder()
for c in columns:
cb.add(c)
self.columns = cppmft.NSCols(cb)
self.columns = columns
self.array = np.array(array)
def read(self):
return [(self.columns, self.array), cppmft.EmptyTable(self.columns)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment