Skip to content

DataStore.to_ndarray

Python

The records as a numpy structured array.

Parameters

count int | None optional

Return an iterator of arrays of at most this many records.

Returns

numpy.ndarray | Iterator[numpy.ndarray]

A structured array.

API method
DataStore.to_ndarray(
    count: int | None = None,
) -> numpy.ndarray | Iterator[numpy.ndarray]
Example usage
import briskapi

client = briskapi.Historical()
data = client.timeseries.get_range(
    dataset="XTKS.BRISKDEMO",
    symbols=["7203"],
    schema="trades",
    start="2021-09-27T09:00",
    end="2021-09-27T09:00:05",
)
records = data.to_ndarray()
print(records.dtype.names[:6])
print(records["price"][:5])
Example responseCaptured from the demo
('ts_recv', 'ts_event', 'publisher_id', 'instrument_id', 'action', 'side')
[10155. 10155. 10155. 10160. 10150.]