Skip to content

Instantly share code, notes, and snippets.

@CrimsonScythe
Created January 8, 2023 15:36
Show Gist options
  • Save CrimsonScythe/2c0a70b22923610a3ce9017bd2cb5f2d to your computer and use it in GitHub Desktop.
Save CrimsonScythe/2c0a70b22923610a3ce9017bd2cb5f2d to your computer and use it in GitHub Desktop.
def square_my_num():
universe = np.arange(100000)
numbers = np.random.rand(100000)
filtered_nums=[]
for number in numbers:
if number in universe:
filtered_nums.append(number)
squares = []
for number in filtered_nums:
squares.append(number ** 2)
def matrix_stuff():
a = np.random.rand(5000,5000)
for i in range(a.shape[0]):
for j in range(a.shape[1]):
if a[i][j] < 0:
a[i][j] = a[i][j]*0
else:
a[i][j] = a[i][j]*1
def main():
matrix_stuff()
square_my_num()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment