Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import numpy as np
- size = 5000
- upperBound = 20
- dataSet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
- dataLength = np.random.randint(0, high=upperBound, size=size, dtype='l')
- randomNumber = np.random.randint(0, high=62, size=size * upperBound, dtype='l')
- count = 0
- dataCount = 0
- start_time = time.time()
- for i in range(size):
- lineData = ""
- for j in range(dataLength[i]):
- lineData = lineData + dataSet[randomNumber[count]]
- count = count + 1
- print(lineData)
- dataCount = dataCount + 1
- time = str(time.time() - start_time)
- print("------------------------n" + "It took this many sedonds: " + time)
- print("There were " + str(dataCount) + " many data generations.")
- import time
- import cupy as cp
- size = 5000
- upperBound = 20
- dataSet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
- dataLength = cp.random.randint(0, high=upperBound, size= size,dtype='l')
- randomNumber = cp.random.randint(0, high=62, size= upperBound * size,dtype='l')
- count = 0
- dataCount = 0
- start_time = time.time()
- for i in range(size):
- lineData = ""
- for j in range(int(dataLength[i])):
- lineData = lineData + str(dataSet[int(randomNumber[count])])
- count = count + 1
- print(lineData)
- dataCount = dataCount + 1
- time = str(time.time() - start_time)
- print("-------------------n" +"It took this many seconds: " + time)
- print("There were " + str(dataCount) + " many data generations.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement