Created
September 18, 2019 10:56
-
-
Save lakshay-arora/7b68539c9a1e22ac9d1f94f98d961fd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing required libraries | |
import pandas as pd | |
import math | |
import multiprocessing as mp | |
from random import randint | |
# function to calculate the number of divisors | |
def countDivisors(n) : | |
count = 0 | |
for i in range(1, (int)(math.sqrt(n)) + 1) : | |
if (n % i == 0) : | |
if (n / i == i) : | |
count = count + 1 | |
else : | |
count = count + 2 | |
return count | |
# create random data | |
random_data = [randint(10,1000) for i in range(1,1000001)] | |
data = pd.DataFrame({'Number' : random_data }) | |
data.shape |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment