cf.Data.second_element

Data.second_element()[source]

Return the second element of the data as a scalar.

New in version 1.7.0.

Returns:The second element of the data.

Examples:

>>> d = cfdm.Data([[1, 2], [3, 4]])
>>> x = d.second_element()
>>> print(x, type(x))
(2, <type 'int'>)
>>> d[0, 1] = numpy.ma.masked
>>> y = d.second_element()
>>> print(y, type(y))
(masked, <class 'numpy.ma.core.MaskedConstant'>)
>>> d = cfdm.Data(['foo', 'bar'])
>>> x = d.second_element()
>>> print(x, type(x))
('bar', <type 'str'>)