larray.Session.items¶
-
Session.
items
(self)[source]¶ Returns a view of the session’s items ((key, value) pairs).
- Returns
- View on the session’s items.
Examples
>>> axis1 = Axis("a=a0..a2") >>> group1 = axis1['a0,a1'] >> 'a01' >>> arr1, arr2 = ndtest((2, 2)), ndtest(4) >>> # make the test pass on both Windows and Linux >>> arr1, arr2 = arr1.astype(np.int64), arr2.astype(np.int64) >>> s = Session([('arr2', arr2), ('arr1', arr1), ('group1', group1), ('axis1', axis1)]) >>> for k, v in s.items(): ... print("{}: {}".format(k, v.info if isinstance(v, Array) else repr(v))) arr2: 4 a [4]: 'a0' 'a1' 'a2' 'a3' dtype: int64 memory used: 32 bytes arr1: 2 x 2 a [2]: 'a0' 'a1' b [2]: 'b0' 'b1' dtype: int64 memory used: 32 bytes group1: a['a0', 'a1'] >> 'a01' axis1: Axis(['a0', 'a1', 'a2'], 'a')