<jupyter_start><jupyter_text>Introduction to Numpy<jupyter_code>import numpy as np
print("Numpy version : ",np.__version__)
#create a simple python list
pythonList = [-5, 4, 0, 3, 9]

#create numpy array from python list
numpyArray = np.array(pythonList)

#display the numpy array
print(numpyArray)
#another method to display numpy array
numpyArray<jupyter_output><empty_output><jupyter_text>**My numpy arrays are just like vectors and we can multiply a vector with a scalor**<jupyter_code>numpyArray*2<jupyter_output><empty_output><jupyter_text>Tuples<jupyter_code># create a tuple with first element an integer, 
# second element a float and third element a complex number
myTuple = (5, -8.35, 7-4J)

#create and display the numpy array of this tuple
print(np.array(myTuple))<jupyter_output>[ 5.  +0.j -8.35+0.j  7.  -4.j]<jupyter_text>Difference between numpy and python Datastructure<jupyter_code>a = [2, 3] # python list
b = np.array([2,3]) #numpy array

a = a*2 # python array will change from [2, 3] to [2, 3, 2, 3]
b = b*2 # numpy is just like a vector and result will be element wise multiplication 

print(a)
print(b)<jupyter_output>[2, 3, 2, 3]
[4 6]<jupyter_text>Python Functions  arange() https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.arange.html<jupyter_code>np.arange(start=7, stop=20, step=1) # start, stop, step
np.arange(7, 20, 3)
np.arange(7, 10) #start, stop
 np.arange(7) #stop is 7 but start is by default 0
np.arange(10, 20, 1) -10 +1 #array manupulation<jupyter_output><empty_output><jupyter_text>linspace() https://docs.scipy.org/doc/numpy/reference/generated/numpy.linspace.html<jupyter_code>np.linspace(start = 2, stop = 10, num=9)
np.linspace(2, 10, 9)
myLinSpace = np.linspace(2, 10, 9, retstep=True)
print("My list: ", myLinSpace[0])
print("Step Size : ", myLinSpace[1])<jupyter_output>Step Size :  1.0<jupyter_text>zeros()<jupyter_code>np.zeros(5)<jupyter_output><empty_output><jupyter_text>ones()<jupyter_code># Vector
np.ones(7)
# Matrix of size 5 x 4
np.ones((5, 4))
# tensor of size 5 x 4 x 3
np.zeros((5, 4, 3))
np.zeros(11, dtype='int64')
np.zeros(11)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13891487371375116, 'fraction_numerical': 0.04583723105706267, 'mean_word_length': 5.9, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 2, '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': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '163254', 'license': 'MIT', 'n_tokens_mistral': 900, 'n_tokens_neox': 841, 'n_words': 218, 'path': '01-Introduction.ipynb', 'repo_name': 'SyedHamedRaza/Numpy', 'size': '2138'}