‫So we have started this jupyter notebook from Anaconda navigator.
‫Now to create a new notebook click on this new button in the top right corner
‫And click on Python 3.
‫This will open a new notebook
‫In a new tab.
‫This is default jupyter-notebook interface.
‫In Notebook you write and run your quotes in a small segment
‫And the segments are called cells.
‫Apart from executing your code this cell can also be used for commenting
‫And it is really helpful
‫Make your code readable
‫And easy to follow.
‫To write the code you just have to click on this cell
‫And for example to add two numbers you can just write two plus two so this is where you will write your codes.
‫Execute this code just
‫Press control enter.
‫So you can write your codes in the cell and you will get the output just below it.
‫You can see
‫For input we have In
‫And for all the outputs we have out.
‫On the top you can see different menu items
‫File contains general options like saving printing
‫or renaming.
‫Edit contains ####### related options
‫Like cut cell ,copy cell, paste cell or Delete cell.
‫View contains interface related option
‫And insert contains option to insert new cells.
‫cells menu item contains execution related options
‫And as the name suggest help contains references and manuals
‫On how to use jupyter notebook.
‫You can also find the list of shortcuts from here,
‫Now most of the options we are going to use are also available in the form of buttons
‫So suppose if I want to rename this file as lecture 1
‫I will do that
‫By clicking on this
‫File name and title and just rename it to lecture 1.
‫To save this file we can click on the save button
‫It will automatically saves your file in your default directory.
‫Next time you open jupyter-notebook you will be able to see this file
‫In your default directory
‫From jupyter-notebook homepage
‫There are also buttons to cut copy paste
‫We also have a button to execute our quotes
‫So again if I
‫If I click on my cell
‫And click on Run It will execute the same.
‫Now you can see this drop down menu is saying code
‫This means the cell we have selected is containing a code
‫If I want it to contain a comment I can change it to either raw or markdown formatting.
‫If I change it to markdown or raw
‫our Python kernel will know that the cell the content of this particular cell is just for
‫For commenting and it will not execute it.
‫The presence of this feature make our code more readable and understandable.
‫So I will go ahead and change the format of this cell to MD.
‫Which is markdown you can see when I am changing my cell to markdown
‫The input symbol goes away there is no input symbol here.
‫Input symbols are present only in the front of codes.
‫I can write anything in this empty cell and Python treat this as a comment so let's go ahead and
‫And write this is a m d cell.
‫Markdown cells also supports markdown formatting
‫So if I want to give heading I can use pound symbol.
‫So will give a heading heading 1,
‫If I execute this
‫You can see since I use pound symbol in front of this heading one the front for heading
‫is the heading format.
‫We can also use multiple pound symbol
‫To change this size
‫So if I use two symbols for heading 2
‫You can see heading two is slightly smaller than heading one you can also
‫use 3 4 5 or 6 Pounds symbol to change the size of the settings.
‫You can also use astrick
‫Symbol
‫To give bullets.
‫So if I write astrick ,if I write bullet
‫Point
‫This asterisk symbol will be directly converted into a bullet.
‫If I execute it you can see
‫The astrick symbols are now converted into bullet and we are seeing all over points in proper bullet.
‫There are multiple features for editing markdown you can Google it
‫And if you want you can learn more about this formatting.
‫Again note that markdown are just for commenting your Python is not actually
‫Executing this cell.
‫The next cell format is raw,raw is similar to markdown but it does not support
‫Formatting.
‫So if you convert it to RAW
‫You convert it to raw it will remain like this
‫You will not be able to get formatting out of this cell.
‫Again raw is also for commenting
‫And Python will not execute it.
‫Code is the format in which we write our codes
‫And Python will only execute cells
‫that are marked as codes.
‫You can see the format for
‫This cell is code therefore I can use my codes in this cell
‫So if I write 2 + 2
‫I can execute it
‫Either by clicking this Run button
‫or by pressing the shortcut key that is control enter.
‫For now
‫I will click on this Run button
‫Similarly if I write 5 + 3
‫This time I will use control enter control enter is a shortcut to run.
‫The sun
‫Execute the same
‫But most of the time
‫We also want to enter a blank cell
‫beneath this cell
‫In that case I can use
‫Alt enter instead of control enter alt enter will execute the cell
‫Also it will insert a blank cell
‫Just below this cell so so write alt enter
‫It has executed the cell and it is inserted a new cell a new blank cell just below
‫this cell.
‫Another small point I want to tell you
‫About cell
‫Is editable and non editable mode.
‫So let's first insert a new cell
‫Now if you try to write anything
‫So if I write
‫Start Tech Academy
‫Nothing will happen
‫Because
‫This cells are not editable right now.
‫You can also notice
‫The colour of the cell is blue the border around this cell is blue
‫This suggest that the cell
‫Currently is an non editable format.
‫If you press enter
‫You can see the cursor
‫Inside the cell and now the blue colour has been changed to green colour
‫Now you can write anything.
‫If I write start Tech Academy you can see we are able to write this in
‫Inside a cell.
‫This mode is editable mode
‫If I press escape
‫You can see the colour has been changed to blue
‫And now we have entered a non editable mode.
‫In non editable mode
‫You can navigate
‫Two different cell and if you want to edit it you have to press enter
‫And the cursor will appear inside the cell and the cell boundary will change to green colour.
‫This two shortcuts
‫Of entering into editable and non editable mode
‫Are very important
‫And it will lay a foundation for other shortcuts as well.
‫So Suppose if you want to change the formatting
‫From code to markdown
‫You can put your cell into non editable mode so I will press escape
‫And then I will press M
‫M is a shortcut for markdown formatting
‫And you can see that
‫The cell type has been changed from court to markdown since right now I am in non editable mode
‫I can press y
‫To change the format of this cell to code.
‫Now to edit the code I just have to press enter to enter into editable mode.
‫Now again to go back to non editable
‫press escape
‫Now I can use shortcuts to change the cell format.
‫If I press r i can change the format of this cell to raw
‫And to switch back I just have to press y.
‫This shortcuts are very handy when you are using python
‫And it will save a lot of time for you
‫Again
‫Now the shortcut to insert new cell is just to enter into non editable mode
‫Press escape if you are in editable mode
‫and press A
‫A will insert a blank cell above your existing cell
‫And similarly B will enter a cell below your existing cell.
‫So I want you to remember this 6 shortcuts first is
‫enter
‫To enter into editable mode
‫of a cell
‫Second is escape
‫To go into the non editable mode of the cell.
‫Third is control enter
‫To executive
‫Selected cell.
‫Fourth one is
‫Alt enter
‫To execute your selected cell and enter a new blank cell below your cell.
‫The fifth one is
‫M
‫Use of m in non editable mode It will change the cell format from code to markdown
‫And the last one is y
‫In the non editable mode
‫If you press y it will change the format of your cell
‫From raw or markDown
‫To code format.
‫Similarly
‫There is one more shortcut if you want to delete your cell just press DD in non editable mode
‫It will delete
‫The selected cell.In the next lecture we'll cover some basic operations and python.