<jupyter_start><jupyter_text>This is a text cell  - First things first  - Second things second<jupyter_code>#  First
print("Hello World")
import numpy as np
# create lists
a = [ 0,1,2,3,4,5] # 6 elements

b = [4,5,6,7,8,9] # 6 elements

print(f"{a}\n{b}") # Using python f strings to print
# Create numpy array from list
c = np.array(a)

# Now, Lets see what the of 'a' and and 'c' are 
print(type(c), type(a))
# Since 'c' is a numpy array, we can use .shape to see its dimensions
print(c.shape)
# Lets create a few more arrays and do basic operations on them using NumPy

i = np.array([0,1,2])
j = np.array([5,6,7])

# add
x = i + j
print(i.shape, j.shape)
print(f"\nx = {x}\n")
print(f"Shape of x = {x.shape}\n")

# Dot product of 2 matrices
print(f"Dot product: {np.dot(i,j)}\n")

# Element wise multiplication of all elements
print(f"Element wise: {i*j}\n")

# Matrix Multiplication 
# Will produce different results than dot product for higher dimensions
y = np.matmul(i , j) 
print(f"y = {y}\n")

# Multiply a vector by a scalar
p = 5*j
print(f"5x the matrix j = {p}\n")

# statistical properties of arrays

# max in an array 
z = np.max(i)
print(f"max = {z}\n")

# min in an array 
x_1 = np.min(i)
print(f"min = {x_1}\n")

# mean, std of array
print(np.mean(i), np.std(i))
# Square all elements of array
f = c**2
f
np.shape(c)
# Change the shape of an array
g = c.reshape(3,2)
print(c.shape, g.shape)<jupyter_output>(6,) (3, 2)
{'fraction_non_alphanumeric': 0.15620641562064155, 'fraction_numerical': 0.021617852161785217, 'mean_word_length': 3.982638888888889, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '413068', 'license': 'MIT', 'n_tokens_mistral': 582, 'n_tokens_neox': 571, 'n_words': 194, 'path': 'Basics.ipynb', 'repo_name': 'poudel-bibek/Intro-to-AI-Assignments', 'size': '1434'}