MaskedArray.tostring(fill_value=None, order='C')

Return the array data as a string containing the raw bytes in the array.

The array is filled with a fill value before the string conversion.


fill_value : scalar, optional

Value used to fill in the masked values. Deafult is None, in which case MaskedArray.fill_value is used.

order : {‘C’,’F’,’A’}, optional

Order of the data item in the copy. Default is ‘C’.

  • ‘C’ – C order (row major).
  • ‘F’ – Fortran order (column major).
  • ‘A’ – Any, current order of array.
  • None – Same as ‘A’.

See also

ndarray.tostring, tolist, tofile


As for ndarray.tostring, information about the shape, dtype, etc., but also about fill_value, will be lost.


>>> x =[[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
>>> x.tostring()

Previous topic

Next topic

This Page