Skip to content

pandas ¤

channel_to_dataframe_decimated ¤

channel_to_dataframe_decimated(
    channel: Channel,
    start: str | datetime | IntegralNanosecondsUTC,
    end: str | datetime | IntegralNanosecondsUTC,
    *,
    buckets: int | None = None,
    resolution: int | None = None
) -> DataFrame

Retrieve the channel data as a pandas.DataFrame, decimated to the given buckets or resolution.

Enter either the number of buckets or the resolution for the output. Resolution in picoseconds for picosecond-granularity dataset, nanoseconds otherwise.

channel_to_series ¤

channel_to_series(
    channel: Channel,
    start: datetime | IntegralNanosecondsUTC | None = None,
    end: datetime | IntegralNanosecondsUTC | None = None,
) -> Series[Any]

Retrieve the channel data as a pandas.Series.

The index of the series is the timestamp of the data. The index name is "timestamp" and the series name is the channel name.

Example:¤

s = channel_to_series(channel)
print(s.name, "mean:", s.mean())

datasource_to_dataframe ¤

datasource_to_dataframe(
    datasource: DataSource,
    channel_exact_match: Sequence[str] = (),
    channel_fuzzy_search_text: str = "",
    start: str | datetime | IntegralNanosecondsUTC | None = None,
    end: str | datetime | IntegralNanosecondsUTC | None = None,
    tags: dict[str, str] | None = None,
) -> DataFrame

Download a dataset to a pandas dataframe, optionally filtering for only specific channels of the dataset.


datasource: The datasource to download data from
channel_exact_match: Filter the returned channels to those whose names match all provided strings
    (case insensitive).
    For example, a channel named 'engine_turbine_rpm' would match against ['engine', 'turbine', 'rpm'],
    whereas a channel named 'engine_turbine_flowrate' would not!
channel_fuzzy_search_text: Filters the returned channels to those whose names fuzzily match the provided
    string.
tags: Dictionary of tags to filter channels by
start: The minimum data updated time to filter channels by
end: The maximum data start time to filter channels by

A pandas dataframe whose index is the timestamp of the data, and column names match those of the selected
    channels.

Example:¤

rid = "..." # Taken from the UI or via the SDK
dataset = client.get_dataset(rid)
df = datasource_to_dataframe(dataset)
print(df.head())  # Show first few rows of data

upload_dataframe ¤

upload_dataframe(
    client: NominalClient,
    df: DataFrame,
    name: str,
    timestamp_column: str,
    timestamp_type: _AnyTimestampType,
    description: str | None = None,
    channel_name_delimiter: str | None = None,
    *,
    wait_until_complete: bool = True
) -> Dataset

Create a dataset in the Nominal platform from a pandas.DataFrame.

If wait_until_complete=True (the default), this function waits until the dataset has completed ingestion before returning. If you are uploading many datasets, set wait_until_complete=False instead and call wait_until_ingestions_complete() after uploading all datasets to allow for parallel ingestion.