Anaconda and Python Installation with Jupyter basics (#New learnings Python#2)
Anaconda is an open-source distribution that simplifies package management and deployment. Package versions are managed by the package management system ‘Conda’. You will need various Python packages (or synonymously, libraries) for specific purposes. Its easier to install Python as well as the packages using Anaconda, since it comes preloaded with most of the packages you’ll need.
Advantages of using Anaconda
- Easy to manage and get started with most requirements for ML/AI problems
- Anaconda comes with many libraries such as NumPy, OpenCV, SciPy, PyQt, the Spyder IDE, etc.
Anaconda can be downloaded from anaconda.org and can be installed like any other normal software. There is no need to download Python separately; the Anaconda installer will do this for you. Make sure you select Python 3.x while downloading Anaconda.
Note for experienced Python programmers: In case you’re already using Python along with an existing package manager such as pip or easy_install, you can continue to do so. However, make sure you’re using Python 3.x.
Jupyter Notebook
You’ll use the Jupyter IPython Notebook as the main environment for writing Python code throughout this program. The main advantage of using Jupyter Notebook is that you can write both code and normal text (using the Markdown format in Jupyter) in the notebooks. These notebooks are easy to read and share and can even be used to present your work to others. Here’s a brief overview of Jupyter Notebook.
Few basic things to remember:
Headings
#
for the titles##
for the main headings###
for the subheadings####
for the smaller subheadings#####
for the italic subheadings
Emphasis
__string__
or**string**
for bold text_string_
or*string*
for italic text
Monospace fonts
- A back single quotation mark
`
on both sides to get monospace fonts
Line breaks
<br>
wherever you want a line break, as the notebook sometimes doesn`t give you the required line break where you want it
Indenting
>
to indent the text>>
for further indenting it, and so on
Bullets and numbering
- A single dash, i.e.
-
followed by two spaces to make bullet points - A number and a dot followed by a space, i.e.
1.
to make numbered lists
Colouring
<font color = blue, yellow, red, pink, green, etc.> String </font>
to give your font any colour that you want
LaTeX Equations
$
on both the sides of the text to write LaTeX equations
For more help while typing, after running cell and the cell turns blue then key in P to see the list:
Command mode shortcuts
Esc
: To go into command modeEnter
: To go back to edit modeM
: To convert a cell to a markdown cellY
: To convert a cell back to a code cellA
: To insert a new cell aboveB
: To insert a new cell belowD + D
: To delete cellZ
: Undo the last operationF
: To find and replace on your codeShift + Up/Down
: To select multiple cellsSpace
: Scroll notebook downwardsShift + Space
: Scroll notebook upwards
Edit mode shortcuts
Shift + Enter
: To execute the code in the current cell and go to the next cellAlt + Enter
: To execute the code in the current cell and insert new cell belowShift + Tab
: To get a brief documentation of the object that you have just typed in the coding cellCtrl + Shift + -
: To split the cell at the cursorShift + M
: To merge selected cells
Refer to Jupyter Notebook Magic Commands for more details.
Will continue to cover more things on Python in the upcoming week. Until then, keep learning :)