<jupyter_start><jupyter_text>Python Basics  List, Set, Dist, Tuple  Day 1  --  7th Jan<jupyter_code># List -> []
# Dict -> {}
# Tuple -> ()

#Problem:- From 100 random numbers find the list of only odd(not prime) and prime numbers
import random


random_numbers = []
odd_not_prime = []
prime = []
even = []


for i in range(0,100):
    random_numbers.append(random.randint(200, 400))


def is_prime_number(x):
    if x >= 2:
        for y in range(2,x):
            if ( x % y  == 0):
                return False
    else:
        return False
    
    return True
        
    
is_prime_number(19)
# build the prime and odd_not_prime list and keep even to assert we are on track and not leaving any number behind
for i in random_numbers:
    if (i % 2 != 0):
        if (is_prime_number(i)):
            prime.append(i)
        else:
            odd_not_prime.append(i)
    else:
        even.append(i)
    
len(prime)
len(odd_not_prime)
len(even)
len(prime) + len(odd_not_prime) + len(even)
# now build up the dict as the above 

random_numbers_for_dict = []
odd_prime_dict = {'prime' : [], 'odd_not_prime' : [], 'even' : []}

for i in range(0,100):
    random_numbers_for_dict.append(random.randint(200, 400))


# build the prime and odd_not_prime Hash Map, or Dict
# and keep even to assert we are on track and not leaving any number behind
for i in random_numbers_for_dict:
    if (i % 2 != 0):
        if (is_prime_number(i)):
            odd_prime_dict['prime'].append(i)
        else:
            odd_prime_dict['odd_not_prime'].append(i)
    else:
        odd_prime_dict['even'].append(i)
len( odd_prime_dict['prime'])
len(odd_prime_dict['odd_not_prime'])
len(odd_prime_dict['even'])
len( odd_prime_dict['prime']) + len(odd_prime_dict['odd_not_prime']) + len(odd_prime_dict['even'])<jupyter_output><empty_output><jupyter_text>------------------ Day 2 ------8th Jan ----------------<jupyter_code>import numpy as np
l1 = [2,4,5,6]
l2 = [6,8,10,12]

l1_1 = [[2,4,5,6]]
l2_2 = [[6,8,10,12]]
l1_array = np.array(l1)
l1_array

# Note this is somewhat absurd since this is the tensor?, which takes the number of channels first in account
l1_array.shape
l1_1_array = np.array(l1_1)
l1_1_array
l1_1_array.shape
l3_3_array = np.concatenate([l1_1, l2_2])
l3_3_array
l3_array = np.concatenate([l1, l2])
l3_array
np.max(l3_3_array, axis=0)
np.max(l3_3_array, axis=1)
np.max(l3_3_array, axis=0).shape
np.max(l3_3_array, axis=1).shape
np.argmax(l3_3_array, axis=0)
np.argmax(l3_3_array, axis=1)
np.sum(l3_3_array, axis =0)
np.sum(l3_3_array, axis =1)
#Classes & Objects<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14379336931380107, 'fraction_numerical': 0.04240555127216654, 'mean_word_length': 3.4511149228130362, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '657922', 'license': 'Apache-2.0', 'n_tokens_mistral': 1044, 'n_tokens_neox': 996, 'n_words': 240, 'path': 'Python_Basics_Day1.ipynb', 'repo_name': 'dhirajhimani/ML-Notes', 'size': '2594'}