<jupyter_start><jupyter_text>Jupyter Notebooks Most of the class will be based on the use of Jupyter Notebooks. Notebooks are handy in any data intensive programming task as they allow you to easily visualize your results without having to _compile_ the code. Each block in a Jupyter Notebook is call a **Cell**.There are two main types of cells:    - Code Cell    - Mardown Cell      Code CellsThese cells are used to input code, the python interpreter will try to compile these cells  Markdown CellsThese cells are used to input text and images (similar to a word processor). They use the **Markdown** language. They are extremelly versatile and allow you organize your code + text. You can also insert images, tables, and files in a markdown cell. Simply drag and drop the image when the cell is in Markdown model. Here is a kitten :) ![image](img.jpg)     To execute a cell, simply press ```    Shift+ Enter```The Markdown language is rich and offers many opportunities to create content. There is a lot of information online if you want to master.   Python as a Calculator Python has the ability perform certain basic math operations. To perform more complex operations, you need to use **Python Packages**.Let us start from the most basic operations<jupyter_code>1 + 2<jupyter_output><empty_output><jupyter_text>Note: If you add a **;** at the end of your statment, the cell won't print the output.<jupyter_code>1 + 2;
1+2
2+3
3+4;<jupyter_output><empty_output><jupyter_text>Note: If you have different operations in the same cell separate by a change in line, the cell will only print the result of the last operation<jupyter_code>1+2, 2+3, 3+5<jupyter_output><empty_output><jupyter_text>Note: If separate the operations with **,**, the cell will print all the result<jupyter_code>#division 
2/5

#multiplication 
_*5
#power 
2**_<jupyter_output><empty_output><jupyter_text>Note: Jupyter carries the value of the last cell's output in a special character **_** Let us try to compute a more complex math operation $$\frac{2*6}{\left(2^3 + \frac{4}{5}\right)}$$By the way, Jupyter notebooks can also interprete $\LaTeX$, so that you can write comples mathematical notation here in the notebook<jupyter_code>(2*6)/(2**3 + (4/5))<jupyter_output><empty_output><jupyter_text>What if I want to compute a more complex operation, like$$2\pi\sin(\frac{\pi}{4})$$We can try that directly and see what happens<jupyter_code>2*pi*sin(pi/4)<jupyter_output><empty_output><jupyter_text>It is telling me that it doesn know what **pi** is. Let us use the value of pi<jupyter_code>2*(3.141516)*sin((3.141516)/4)<jupyter_output><empty_output><jupyter_text>Now is telling me that it doesn know what **sin** is.  Python doesn't know math beyond basic operations We need to use **Packages** which are basically pieces of code that someone else created so solve specific problems. We will use the ```math``` package to do complex math operations<jupyter_code>import math

math.pi/180
2*(math.pi)*math.sin(45*_)<jupyter_output><empty_output><jupyter_text>The math package provides access to many common mathematical operations. You can access those operations by using the dot notation``` pythonmath.TheNameofTheOperation```To know which operations are avaliable in the math package, simple press **Tab** after the dot and you will see a list of available functions. To learn more about a specific function, you can use the **?** notation``` pythonmath.sin?```Using the **?** notation will open the documentation of the function. You could also import a single function from the package. That way, you avoid using more memory that you need``` pythonfrom math import sin, pi2*(pi)*sin((pi)/4)```<jupyter_code>#square root
math.sqrt(16)
#logarith
math.log10(10), math.log(math.e), math.log2(2)
#Exponent
math.exp(math.log(math.e))<jupyter_output><empty_output><jupyter_text>$$\huge{e^{log_{e}(e)} = e^{1} = e }$$ Python can also handle complex numbers and operations<jupyter_code>3+5j
type(3+5j)
(3+5j) + (4+6j);<jupyter_output><empty_output><jupyter_text>The ```type```keyword can tell you what type of variable is being analized.<jupyter_code>type(3), type(math.pi), type(4+1j);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09811410837908809, 'fraction_numerical': 0.019097636667462402, 'mean_word_length': 5.725521669341894, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, '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': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '618316', 'license': 'MIT', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1244, 'n_words': 521, 'path': 'Introduction.ipynb', 'repo_name': 'dguari1/BME3240_2021', 'size': '4189'}