Notebook.create_output_table

Notebook.create_output_table(data, *, name=None, append=False, geography_variables=None) → Table

Create an output table from within a running notebook. Pass various data structures or reference an existing file on disk.

Parameters:

data : str | pandas.DataFrame | pyarrow.Dataset | pyarrow.Table | dask.DataFrame | polars.DataFrame | polars.LazyFrame | geopandas.GeoDataFrame The data content to pass to the output table. If a string, assumed to be the path to a parquet file, which must end in ".parquet". Otherwise, the provided data object is converted to parquet and uploaded to the output table.

name: str, default None The name of the output table. If not specified, will be automatically set based on the name of the notebook.

append: bool, default False If set to True, the data contents will be appended to the output table. Otherwise, the output table will be replaced with the contents (the default behavior).

geography_variables: list, default None A list of variables that should be interpreted as the geography type. Will be automatically inferred when passing a geopandas.GeoDataFrame or parquet file (implementing the geoparquet specification) via the data parameter.

Returns

Table

Examples

df = get_dataframe_somehow()

notebook = redivis.current_notebook()

# Create an output table on the current notebook
# Optional parameter, append (default False), determines whether the output appends to
#  or replaces the output table.
notebook.create_output_table(df, append=False) 

# Can also pass a path to a parquet file or csv
notebook.create_output_table("path/to/file.parquet")

Last updated

Was this helpful?