How to use the pantab.frame_to_hyper function in pantab

To help you get started, we’ve selected a few pantab examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ow2-proactive / proactive-examples / MachineLearningScripts / resources / catalog / Utils.py View on Github external
def export_dataframe_tableau(dataframe, filename="dataframe.hyper"):
    """
    Export a Pandas dataframe to a Tableau file.

    :param dataframe: Pandas dataframe.
    :param filename: Python string.
    :return: None.
    """
    global result
    import pantab
    # TODO: Fix ModuleNotFoundError: No module named 'tableauhyperapi'
    result = dataframe.to_json(orient='split')
    pantab.frame_to_hyper(dataframe, filename)
    with open(filename, "rb") as binary_file:
        file_bin = binary_file.read()
    assert file_bin is not None
    result = file_bin
    resultMetadata.put("file.extension", ".hyper")
    resultMetadata.put("file.name", filename)
    resultMetadata.put("content.type", "application/octet-stream")
github innobi / pantab / benchmarks / benchmarks.py View on Github external
{
                "int16": np.int16,
                "int32": np.int32,
                "int64": np.int64,
                "float32": np.float32,
                "float64": np.float64,
                "bool": np.bool,
                "datetime64": "datetime64[ns]",
                "datetime64_utc": "datetime64[ns, UTC]",
                "timedelta64": "timedelta64[ns]",
                "object": "object",
            }
        )

        path = "test.hyper"
        pantab.frame_to_hyper(df, path, table="test")
        return df
github innobi / pantab / benchmarks / benchmarks.py View on Github external
def peakmem_write_frame(self):
        pantab.frame_to_hyper(self.df, "dummy.hyper", table="dummy")
github innobi / pantab / benchmarks / benchmarks.py View on Github external
def time_write_frame(self, df):
        pantab.frame_to_hyper(df, "dummy.hyper", table="dummy")
github innobi / pantab / benchmarks / benchmarks.py View on Github external
def time_write_frame(self):
        pantab.frame_to_hyper(self.df, "dummy.hyper", table="dummy")
github innobi / pantab / benchmarks / benchmarks.py View on Github external
def setup_cache(self):
        df = pd.DataFrame(np.ones((10_000_000, 1)), columns=["a"])
        path = "test.hyper"
        pantab.frame_to_hyper(df, path, table="test")

pantab

Converts pandas DataFrames into Tableau Hyper Extracts and back

BSD-3-Clause
Latest version published 20 hours ago

Package Health Score

90 / 100
Full package analysis

Similar packages