Every line of 'python create array' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
235 def Array(typecode_or_type, size_or_initializer, **kwds): 236 ''' 237 Returns a shared array 238 ''' 239 from processing.sharedctypes import Array 240 return Array(typecode_or_type, size_or_initializer, **kwds)
212 def cArray (self, arrTy, arrSize = None): 213 ret_val = {"ty" : "array", "elemty" : arrTy, "array" : arrSize} 214 return ret_val
81 def ConstructArray(self, py_arr): 82 ''' note py_arr elems are NOT converted to PyJs types!''' 83 arr = self.NewArray(len(py_arr)) 84 arr._init(py_arr) 85 return arr
37 def test_construct(self): 38 a = bf.ndarray(self.known_vals, dtype='f32') 39 np.testing.assert_equal(a, self.known_array)
12 def create_array(): 13 """Creates a simple 3D numpy array with unique values at each 14 location in the matrix. 15 16 """ 17 rows, cols, depth = 2, 3, 4 18 arr = numpy.zeros((rows, cols, depth), 'i') 19 count = 0 20 for i in range(rows): 21 for j in range(cols): 22 for k in range(depth): 23 arr[i,j,k] = count 24 count += 1 25 return arr