Skip to content

kolena.io

kolena.io provides helper functions for converting pandas.DataFrames containing to and from common serializable formats while adhering to the JSON specifications, and preserving non-primitive data objects.

dataframe_to_csv(df, *args, **kwargs) #

Helper function to export pandas DataFrame containing annotation or asset to CSV format.

Parameters:

Name Type Description Default
args Any

positional arguments to pandas.DataFrame.to_csv.

()
kwargs Any

keyword arguments to pandas.DataFrame.to_csv.

{}

Returns:

Type Description
Union[str, None]

None or str.

dataframe_from_csv(*args, **kwargs) #

Helper function to load pandas DataFrame exported to CSV with dataframe_to_csv.

Parameters:

Name Type Description Default
args Any

positional arguments to pandas.DataFrame.read_csv.

()
kwargs Any

keyword arguments to pandas.DataFrame.read_csv.

{}

Returns:

Type Description
DataFrame

DataFrame.

dataframe_to_parquet(df, *args, **kwargs) #

Helper function to export pandas DataFrame containing annotation or asset to Parquet format.

Parameters:

Name Type Description Default
args Any

positional arguments to pandas.DataFrame.to_parquet.

()
kwargs Any

keyword arguments to pandas.DataFrame.to_parquet.

{}

Returns:

Type Description
Union[bytes, None]

None or str.

dataframe_from_parquet(*args, **kwargs) #

Helper function to load pandas DataFrame exported to Parquet with dataframe_to_parquet.

Parameters:

Name Type Description Default
args Any

positional arguments to pandas.DataFrame.read_parquet.

()
kwargs Any

keyword arguments to pandas.DataFrame.read_parquet.

{}

Returns:

Type Description
DataFrame

DataFrame.

dataframe_from_json(*args, **kwargs) #

Helper function to load pandas DataFrame containing annotation or asset from JSON file or string.

Parameters:

Name Type Description Default
args Any

positional arguments to pandas.DataFrame.read_json.

()
kwargs Any

keyword arguments to pandas.DataFrame.read_json.

{}

Returns:

Type Description
DataFrame

DataFrame.