numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
tobytes(self, fill_value=None, order='C')

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

versionadded

Notes

As for :None:None:`ndarray.tobytes`, information about the shape, dtype, etc., but also about fill_value , will be lost.

Parameters

fill_value : scalar, optional

Value used to fill in the masked values. Default 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'.

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

See Also

numpy.ndarray.tobytes
tofile
tolist

Examples

This example is valid syntax, but we were not able to check execution
>>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
... x.tobytes() b'\x01\x00\x00\x00\x00\x00\x00\x00?B\x0f\x00\x00\x00\x00\x00?B\x0f\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00'
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.ma.core.MaskedArray.tostring

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/ma/core.py#6066
type: <class 'function'>
Commit: