5 examples of 'initialise array in python' in Python

Every line of 'initialise array in python' 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.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
13def __init__(self, arr):
14 assert arr is not None
15 self.shape = arr.shape
16 self.array = arr
17 self.size = self.array.size
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

97def __init__(self, elemtype, *ignored):
98 '''Note: elemcount is ignored when using in the Python scope.
99 '''
100 self.elemtype = elemtype
53def __init__(self, size):
54 assert size > 0, "Array size must be > 0"
55 self._size = size
56 PyArrayType = ctypes.py_object * size
57 self._elements = PyArrayType()
58 self.clear(None)
301def __init__(self, db, ARRAY, varlength=1):
302 self.db = db
303 self.ARRAY = ARRAY
304 self.LLTYPE = ARRAY
305 self.varlength = varlength
306 self.dependencies = {}
307 self.itemtypename = db.gettype(ARRAY.OF, who_asks=self)
81def 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

Related snippets