Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- l=list(range(0,1000000000))
- import numpy as np
- MAXSIZE = 1000000
- l = np.empty(MAXSIZE, dtype=np.int16)
- L = [None] * 10**9
- L = []
- import array
- a = array.array('i', [0]) * 10**9
- R = range(10**9)
- import array
- # i - integer https://docs.python.org/3/library/array.html
- # array<any> создать нельзя.
- arr = array.array('i', range(1000000))
- import numpy as np
- from scipy.sparse import coo_matrix
- row = np.random.randint(10**10, size=10**3, dtype=np.int64)
- col = np.array([0] * 10**3)
- data = np.random.randint(255, size=10**3)
- coo = coo_matrix((data, (row, col)), shape=(10**20, 1))
- In [29]: coo
- Out[29]:
- <100000000000000000000x1 sparse matrix of type '<class 'numpy.int32'>'
- with 1000 stored elements in COOrdinate format>
- In [30]: coo.shape
- Out[30]: (100000000000000000000, 1)
Add Comment
Please, Sign In to add comment