Created
May 21, 2024 16:28
-
-
Save kaykurokawa/e399c301a2c087f66739f463126f474f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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