<jupyter_start><jupyter_text>DATA  690 - Lecture 10 Assignment  Creating a sample code of partitioning. Use 5 as k argumemnt.<jupyter_code>import numpy as np
x=np.random.randint(low=1, high=20, size=10)
print('\nGiven Array is : ', x)
print('\nPartitioned Array is : ', np.partition(x,5))<jupyter_output>Given Array is :  [17  2 18 14 16  6 12 19  8 12]

Partitioned Array is :  [ 2  6  8 12 12 14 16 19 18 17]<jupyter_text>Sample Structure Array<jupyter_code>data = np.zeros(10, dtype={'names':('orderdate', 'orderamount', 'ordernumber', 'ordername'),
                          'formats':('U8', 'f8', 'i4',  'U20')})
OrderDate = ["1/2/2021", "4/3/2021","2/2/2021" ,"3/3/2021", "8/4/2021","6/3/2021", "2/5/2021", "6/2/2021", "1/5/2021","8/2/2021"]
OrderAmount = np.random.randint(low=50, high=100, size=10)
OrderNumber = [101,102,103,104,105,106,107,108,109,110]
OrderName = ["Mike","John","Rick","Milton","Juce","Jally","Cosher","Pary","Nelson","Miroz"]

data ["orderdate"]=OrderDate
data["orderamount"]= OrderAmount
data["ordernumber"]= OrderNumber
data["ordername"] = OrderName
print(data)
data[data['ordernumber'] < 105]<jupyter_output><empty_output><jupyter_text>Generating the array<jupyter_code>rng = np.random.RandomState(0)
x = rng.randint(10, size=(10, 10))
print(x)
a1 = np.array([0, 2, 4,6,8])
a2 = np.array([0,3, 4, 6, 7])
x[a1[:, np.newaxis], a2]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.20215827338129497, 'fraction_numerical': 0.1251798561151079, 'mean_word_length': 5.719806763285024, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '333303', 'license': 'Unlicense', 'n_tokens_mistral': 672, 'n_tokens_neox': 568, 'n_words': 113, 'path': 'Data690_SaidaBabu_HW10_partitioning.ipynb', 'repo_name': 'iamsaida/python-codes', 'size': '1390'}