iode.Scalars.i

property Scalars.i: PositionalIndexer

Allow to select the ith scalar in the database.

Examples

>>> from iode import scalars, SAMPLE_DATA_DIR
>>> scalars.load(f"{SAMPLE_DATA_DIR}/fun.scl")
Loading .../fun.scl
161 objects loaded 
>>> # get the first scalar
>>> scalars.i[0]
Scalar(0.0157684, 1, 0.00136871)
>>> # get the last scalar
>>> scalars.i[-1]
Scalar(-7.27124, 1, 2.6764)
>>> # update first scalar
>>> scalars.i[0] = 0.02
>>> scalars.i[0]
Scalar(0.02, 1, na)
>>> # update last scalar
>>> scalars.i[-1] = -7.3, 0.5
>>> scalars.i[-1]
Scalar(-7.3, 0.5, na)