Lines Matching refs:np

8     import numpy as np
13 ld = np.dtype('longdouble')
14 return np.dtype({'names': ['bool_', 'uint_', 'float_', 'ldbl_'],
21 return np.dtype([('bool_', '?'), ('uint_', 'u4'), ('float_', 'f4'), ('ldbl_', 'g')])
33 ld = np.dtype('longdouble')
41 np.dtype('longdouble').itemsize, e='<' if byteorder == 'little' else '>')
45 return 12 + 4 * (np.dtype('uint64').alignment > 4) + 8 + 8 * (
46 np.dtype('longdouble').alignment > 8)
50 ld = np.dtype('longdouble')
56 ld = np.dtype('longdouble')
65 np.testing.assert_equal(actual, np.array(expected_data, dtype=expected_dtype))
73 ld = np.dtype('longdouble')
76 dbl = np.dtype('double')
113 d1 = np.dtype({'names': ['a', 'b'], 'formats': ['int32', 'float64'],
115 d2 = np.dtype([('a', 'i4'), ('b', 'f4')])
116 assert m.test_dtype_ctors() == [np.dtype('int32'), np.dtype('float64'),
117 np.dtype('bool'), d1, d1, np.dtype('uint32'), d2]
119 assert m.test_dtype_methods() == [np.dtype('int32'), simple_dtype, False, True,
120 np.dtype('int32').itemsize, simple_dtype.itemsize]
122 assert m.trailing_padding_dtype() == m.buffer_to_dtype(np.zeros(1, m.trailing_padding_dtype()))
152 nested_dtype = np.dtype([('a', simple_dtype), ('b', packed_dtype)])
182 np.testing.assert_equal(arr['a'], m.create_rec_partial(3))
186 data = np.arange(1, 7, dtype='int32')
188 np.testing.assert_array_equal(m.test_array_ctors(10 + i), data.reshape((3, 2)))
189 np.testing.assert_array_equal(m.test_array_ctors(20 + i), data.reshape((3, 2)))
191 np.testing.assert_array_equal(m.test_array_ctors(30 + i), data)
192 np.testing.assert_array_equal(m.test_array_ctors(40 + i), data)
241 assert dtype == np.dtype([('e1', e + 'i8'), ('e2', 'u1')])
258 assert dtype == np.dtype([('cflt', e + 'c8'), ('cdbl', e + 'c16')])
303 assert d is np.dtype("f4")