module documentation

Undocumented

Constant NPY​_RELAXED​_STRIDES​_CHECKING Undocumented
Function test​_array​_array Undocumented
Function test​_array​_astype Undocumented
Function test​_array​_astype​_to​_string​_discovery​_empty Undocumented
Function test​_array​_astype​_to​_void Undocumented
Function test​_array​_astype​_warning Undocumented
Function test​_array​_impossible​_casts Undocumented
Function test​_astype​_copyflag Undocumented
Function test​_broadcast​_arrays Undocumented
Function test​_contiguous​_flags Undocumented
Function test​_copy​_order Undocumented
Function test​_copyto Undocumented
Function test​_copyto​_fromscalar Undocumented
Function test​_copyto​_permut Undocumented
Function test_fast​Copy​And​Transpose Undocumented
Function test​_full​_from​_list Undocumented
Function test​_none​_to​_nan​_cast Undocumented
Function test​_object​_array​_astype​_to​_void Undocumented
Function test​_string​_to​_boolean​_cast Currently, for astype strings are cast to booleans effectively by calling bool(int(string). This is not consistent (see gh-9875) and will eventually be deprecated.
Function test​_string​_to​_boolean​_cast​_errors These currently error out, since cast to integers fails, but should not error out in the future.
Function test​_string​_to​_complex​_cast Undocumented
NPY_RELAXED_STRIDES_CHECKING =

Undocumented

Value
np.ones((10, 1), order='C').flags.f_contiguous
def test_array_array():

Undocumented

def test_array_astype():

Undocumented

@pytest.mark.parametrize('dt', ['S', 'U'])
def test_array_astype_to_string_discovery_empty(dt):

Undocumented

@pytest.mark.parametrize('dt', ['d', 'f', 'S13', 'U32'])
def test_array_astype_to_void(dt):

Undocumented

@pytest.mark.parametrize('t', (np.sctypes['uint']+np.sctypes['int'])+np.sctypes['float'])
def test_array_astype_warning(t):

Undocumented

@pytest.mark.parametrize('array', [True, False])
def test_array_impossible_casts(array):

Undocumented

def test_astype_copyflag():

Undocumented

def test_broadcast_arrays():

Undocumented

def test_contiguous_flags():

Undocumented

def test_copy_order():

Undocumented

def test_copyto():

Undocumented

def test_copyto_fromscalar():

Undocumented

def test_copyto_permut():

Undocumented

def test_fastCopyAndTranspose():

Undocumented

@pytest.mark.parametrize(['shape', 'fill_value', 'expected_output'], [((2, 2), [5.0, 6.0], np.array([[5.0, 6.0], [5.0, 6.0]])), ((3, 2), [1.0, 2.0], np.array([[1.0, 2.0], [1.0, 2.0], [1.0, 2.0]]))])
def test_full_from_list(shape, fill_value, expected_output):

Undocumented

@pytest.mark.parametrize('dtype', np.typecodes['AllFloat'])
def test_none_to_nan_cast(dtype):

Undocumented

def test_object_array_astype_to_void():

Undocumented

@pytest.mark.parametrize(['dtype', 'out_dtype'], [(np.bytes_, np.bool_), (np.unicode_, np.bool_), (np.dtype('S10,S9'), np.dtype('?,?'))])
def test_string_to_boolean_cast(dtype, out_dtype):
Currently, for astype strings are cast to booleans effectively by calling bool(int(string). This is not consistent (see gh-9875) and will eventually be deprecated.
@pytest.mark.parametrize(['dtype', 'out_dtype'], [(np.bytes_, np.bool_), (np.unicode_, np.bool_), (np.dtype('S10,S9'), np.dtype('?,?'))])
def test_string_to_boolean_cast_errors(dtype, out_dtype):
These currently error out, since cast to integers fails, but should not error out in the future.
@pytest.mark.parametrize('str_type', [str, bytes, np.str_, np.unicode_])
@pytest.mark.parametrize('scalar_type', [np.complex64, np.complex128, np.clongdouble])
def test_string_to_complex_cast(str_type, scalar_type):

Undocumented