Python numpy.ndarray.tobytes() Examples

The following are code examples for showing how to use numpy.ndarray.tobytes(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: core.py    GNU General Public License v3.0 6 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        state = (1,
                 self.shape,
                 self.dtype,
                 self.flags.fnc,
                 self._data.tobytes(cf),
                 #self._data.tolist(),
                 getmaskarray(self).tobytes(cf),
                 #getmaskarray(self).tolist(),
                 self._fill_value,
                 )
        return state
    # 
Example 2
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: core.py    MIT License 6 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        state = (1,
                 self.shape,
                 self.dtype,
                 self.flags.fnc,
                 self._data.tobytes(cf),
                 # self._data.tolist(),
                 getmaskarray(self).tobytes(cf),
                 # getmaskarray(self).tolist(),
                 self._fill_value,
                 )
        return state 
Example 3
Project: 3dprinteros-client   Author: panasevychol   File: core.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        state = (1,
                 self.shape,
                 self.dtype,
                 self.flags.fnc,
                 self._data.tobytes(cf),
                 #self._data.tolist(),
                 getmaskarray(self).tobytes(cf),
                 #getmaskarray(self).tolist(),
                 self._fill_value,
                 )
        return state
    # 
Example 4
Project: linear_neuron   Author: uglyboxer   File: core.py    MIT License 6 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        state = (1,
                 self.shape,
                 self.dtype,
                 self.flags.fnc,
                 self._data.tobytes(cf),
                 # self._data.tolist(),
                 getmaskarray(self).tobytes(cf),
                 # getmaskarray(self).tolist(),
                 self._fill_value,
                 )
        return state 
Example 5
Project: linux-cross-gcc   Author: nmercier   File: core.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        state = (1,
                 self.shape,
                 self.dtype,
                 self.flags.fnc,
                 self._data.tobytes(cf),
                 # self._data.tolist(),
                 getmaskarray(self).tobytes(cf),
                 # getmaskarray(self).tolist(),
                 self._fill_value,
                 )
        return state 
Example 6
Project: ImageFusion   Author: pfchai   File: core.py    MIT License 6 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        state = (1,
                 self.shape,
                 self.dtype,
                 self.flags.fnc,
                 self._data.tobytes(cf),
                 #self._data.tolist(),
                 getmaskarray(self).tobytes(cf),
                 #getmaskarray(self).tolist(),
                 self._fill_value,
                 )
        return state
    # 
Example 7
Project: LaserTOF   Author: kyleuckert   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 8
Project: LaserTOF   Author: kyleuckert   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 9
Project: LaserTOF   Author: kyleuckert   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 10
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order=order) 
Example 11
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> 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'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 12
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 13
Project: recruit   Author: Frank-qlu   File: core.py    Apache License 2.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 14
Project: recruit   Author: Frank-qlu   File: core.py    Apache License 2.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 15
Project: recruit   Author: Frank-qlu   File: core.py    Apache License 2.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 16
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C')
    #........................ 
Example 17
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order)
    #........................ 
Example 18
Project: FUTU_Stop_Loss   Author: BigtoC   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 19
Project: FUTU_Stop_Loss   Author: BigtoC   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 20
Project: FUTU_Stop_Loss   Author: BigtoC   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 21
Project: MARRtino-2.0   Author: DaniAffCH   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order=order) 
Example 22
Project: MARRtino-2.0   Author: DaniAffCH   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> 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'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 23
Project: MARRtino-2.0   Author: DaniAffCH   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 24
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 25
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 26
Project: vnpy_crypto   Author: birforce   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 27
Project: vnpy_crypto   Author: birforce   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 28
Project: vnpy_crypto   Author: birforce   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 29
Project: ble5-nrf52-mac   Author: tomasero   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 30
Project: ble5-nrf52-mac   Author: tomasero   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 31
Project: ble5-nrf52-mac   Author: tomasero   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 32
Project: poker   Author: surgebiswas   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 33
Project: poker   Author: surgebiswas   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 34
Project: poker   Author: surgebiswas   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 35
Project: P3_image_processing   Author: latedude2   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order=order) 
Example 36
Project: P3_image_processing   Author: latedude2   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> 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'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 37
Project: P3_image_processing   Author: latedude2   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 38
Project: GraphicDesignPatternByPython   Author: Relph1119   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 39
Project: GraphicDesignPatternByPython   Author: Relph1119   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 40
Project: GraphicDesignPatternByPython   Author: Relph1119   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 41
Project: 3dprinteros-client   Author: panasevychol   File: core.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C')
    #........................ 
Example 42
Project: 3dprinteros-client   Author: panasevychol   File: core.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order)
    #........................ 
Example 43
Project: 3dprinteros-client   Author: panasevychol   File: core.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C')
    #........................ 
Example 44
Project: 3dprinteros-client   Author: panasevychol   File: core.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order)
    #........................ 
Example 45
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: core.py    Apache License 2.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 46
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: core.py    Apache License 2.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 47
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: core.py    Apache License 2.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 48
Project: fund   Author: Frank-qlu   File: core.py    Apache License 2.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 49
Project: fund   Author: Frank-qlu   File: core.py    Apache License 2.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 50
Project: fund   Author: Frank-qlu   File: core.py    Apache License 2.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 51
Project: pySINDy   Author: luckystarufo   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 52
Project: pySINDy   Author: luckystarufo   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 53
Project: pySINDy   Author: luckystarufo   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 54
Project: linear_neuron   Author: uglyboxer   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 55
Project: linear_neuron   Author: uglyboxer   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 56
Project: facethin   Author: ParkerGod   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 57
Project: facethin   Author: ParkerGod   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 58
Project: facethin   Author: ParkerGod   File: core.py    GNU General Public License v3.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 59
Project: islam-buddy   Author: hamir   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 60
Project: islam-buddy   Author: hamir   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 61
Project: islam-buddy   Author: hamir   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 62
Project: mxnet-lambda   Author: awslabs   File: core.py    Apache License 2.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 63
Project: mxnet-lambda   Author: awslabs   File: core.py    Apache License 2.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 64
Project: mxnet-lambda   Author: awslabs   File: core.py    Apache License 2.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 65
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 66
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 67
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 68
Project: psychrometric-chart-makeover   Author: buds-lab   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 69
Project: psychrometric-chart-makeover   Author: buds-lab   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 70
Project: psychrometric-chart-makeover   Author: buds-lab   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 71
Project: wine-ml-on-aws-lambda   Author: pierreant   File: core.py    Apache License 2.0 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 72
Project: wine-ml-on-aws-lambda   Author: pierreant   File: core.py    Apache License 2.0 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 73
Project: wine-ml-on-aws-lambda   Author: pierreant   File: core.py    Apache License 2.0 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 74
Project: linux-cross-gcc   Author: nmercier   File: core.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C') 
Example 75
Project: linux-cross-gcc   Author: nmercier   File: core.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 76
Project: SignLanguage_ML   Author: mareep-raljodid   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order=order) 
Example 77
Project: SignLanguage_ML   Author: mareep-raljodid   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        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'.

        See Also
        --------
        ndarray.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> 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'

        """
        return self.filled(fill_value).tobytes(order=order) 
Example 78
Project: SignLanguage_ML   Author: mareep-raljodid   File: core.py    MIT License 5 votes vote down vote up
def __getstate__(self):
        """Return the internal state of the masked array, for pickling
        purposes.

        """
        cf = 'CF'[self.flags.fnc]
        data_state = super(MaskedArray, self).__reduce__()[2]
        return data_state + (getmaskarray(self).tobytes(cf), self._fill_value) 
Example 79
Project: ImageFusion   Author: pfchai   File: core.py    MIT License 5 votes vote down vote up
def tostring(self, fill_value=None, order='C'):
        """
        This function is a compatibility alias for tobytes. Despite its name it
        returns bytes not strings.
        """

        return self.tobytes(fill_value, order='C')
    #........................ 
Example 80
Project: ImageFusion   Author: pfchai   File: core.py    MIT License 5 votes vote down vote up
def tobytes(self, 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.

        .. versionadded:: 1.9.0

        Parameters
        ----------
        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.tobytes
        tolist, tofile

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

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tobytes()
        '\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'

        """
        return self.filled(fill_value).tobytes(order=order)
    #........................