HomeGuidesAPI ReferenceChangelog
Log In
API Reference

DataFrame Utilities

top-level utility functions to convert DataFrames between Wizata-compatible formats.

All DataFrames used by Wizata must follow a specific format: a Timestamp index and float-compatible data types.

Functions

df_from_csv()

convert bytes representing a CSV file to a pandas DataFrame.

NameTypeDefaultDescription
b_databytesbytes representing a CSV file.
return: pandas DataFrame formatted to Wizata standards.
import wizata_dsapi

with open("data.csv", "rb") as f:
    df = wizata_dsapi.df_from_csv(f.read())

df_from_dict()

convert a dict into a valid Wizata dataframe.

NameTypeDefaultDescription
df_dictdictdataframe dictionary.
return: pandas DataFrame.

df_from_json()

convert a dictionary dataframe using JSON convention into a pandas DataFrame. Dataframe must contain a timestamp column and be compatible to float data types.

NameTypeDefaultDescription
jsonJSON formatted dataframe.
return: pandas DataFrame.

df_to_csv()

convert a DataFrame to a strongly formatted CSV as bytes.

NameTypeDefaultDescription
dfpandas.DataFramepandas DataFrame compatible with Wizata standards.
return: bytes containing the full CSV file.

df_to_dict()

convert a DataFrame to a dictionary.

NameTypeDefaultDescription
dfpandas.DataFramedataframe to format.
format_strstrdefaultformat to use: 'default' or 'grafana'.
return: dictionary representation.

df_to_json()

convert a pandas DataFrame to a JSON-compatible dictionary. Dataframe must be compatible to Wizata format using Timestamp index and float data types.

NameTypeDefaultDescription
dfpandas.DataFramepandas DataFrame to convert.
return: dictionary representing a JSON-compatible dataframe.

validate()

validate a dataframe format to match supported Wizata format. Raises an error if not valid.

NameTypeDefaultDescription
dfpandas.DataFramedataframe to validate.
return: validated and formatted DataFrame.