Retrieve rows in a pandas dataframe

async AsyncCogniteClient.sequences.data.retrieve_dataframe(
start: int,
end: int | None,
columns: list[str] | None = None,
external_id: str | None = None,
column_names: str | None = None,
id: int | None = None,
limit: int | None = None,
) pd.DataFrame

Retrieve data from a sequence as a pandas dataframe.

Parameters:
  • start (int) – (inclusive) row number to start from.

  • end (int | None) – (exclusive) upper limit on the row number. Set to None or -1 to get all rows until end of sequence.

  • columns (list[str] | None) – List of external id for the columns of the sequence. If ‘None’ is passed, all columns will be retrieved.

  • external_id (str | None) – External id of sequence.

  • column_names (str | None) – Which field(s) to use as column header. Can use “externalId”, “id”, “columnExternalId”, “id|columnExternalId” or “externalId|columnExternalId”. Default is “externalId|columnExternalId” for queries on more than one sequence, and “columnExternalId” for queries on a single sequence.

  • id (int | None) – Id of sequence

  • limit (int | None) – Maximum number of rows to return per sequence.

Returns:

The requested sequence data in a pandas DataFrame

Return type:

pd.DataFrame

Examples

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> df = client.sequences.data.retrieve_dataframe(id=1, start=0, end=None)