def _ndarray_representer ( dumper , data ) : mapping = [ ( 'object' , data . tolist ( ) ) , ( 'dtype' , data . dtype . name ) ] return dumper . represent_mapping ( _NUMPY_ARRAY_TAG , mapping )
making list dumpy,narray in python
def _ndarray_representer(dumper, data):
    """

    :param dumper:
    :param data:
    :type data: :class:`numpy.ndarray`
    :return:
    """
    mapping = [('object', data.tolist()), ('dtype', data.dtype.name)]
    return dumper.represent_mapping(_NUMPY_ARRAY_TAG, mapping)