Datasets#
- Dynamic homogeneous multi-dimensional numerical data stored in - std::vector. Used to record data collected during an- ExperimentalRun.- navground.sim.Datasetsupports the buffer protocol and is convertible to and from a- numpy.ndarray:- >>> from navground import sim >>> import numpy >>> >>> ds = sim.Dataset(data=numpy.array([1, 2, 3], dtype=numpy.uint8)) >>> ds <Dataset: shape (3,), dtype uint8> >>> numpy.asarray(ds) array([1, 2, 3], dtype=uint8) - Instantiate a dataset with an object convertible to a numpy array of one of the types of - navground::sim::Dataset::Scalar.- Parameters:
- data ( - numpy.typing.ArrayLike| None) – Copies shape, data and dtype from this numpy array (if specified)
- dtype ( - numpy.typing.DTypeLike| None.) – The type of data to store (if specified and if- datais None)
- item_shape (list[int]) – Set the shape of all axis except the first (only if - datais None ). Set to an empty list to instantiate a flat dataset.
 
 
 - Append items from (objects convertible to) numpy arrays of one of the types of - navground::sim::Dataset::Scalar.- Parameters:
- values ( - numpy.typing.ArrayLike) – Append data and dtype from this numpy array
- reset (bool) – Whether to replace the data instead of appending. 
 
 
 - Copy one dataset entry to a new buffer - Parameters:
- index – The index of the entry. Set to -1 to add all entries. 
- Returns:
- The buffer 
 
 - Add an item of one of the types of - navground::sim::Dataset::Scalar.- The item will be converted to the current data type, see - dtype().- Parameters:
- value ( - numbers.Real) – The value to add
 
 - Clear all data. 
 - Writes a buffer with the content of one dataset entry. - Parameters:
- buffer – The buffer 
- index – The index of the entry 
 
- Returns:
- True if writing was successful. 
 
 - Type:
 - The type of the dataset. - Can be set to any object that is convertible to - numpy.dtype.
 - Type:
 - Determines if valid.