3-PythonInstallation Sammatrix
3-PythonInstallation Sammatrix
Conda Pip
Manages binaries wheel or source
Require Compiler No Yes
Package type Any Python only
Create environment Yes-built in No require virtualenv or venv
Check dependencies Yes No
Package Source Anaconda repo and cloud PyPI
Anaconda Navigator
• Anaconda Navigator is a desktop graphical user interface (GUI)
included in Anaconda distribution that allows you to launch
applications and easily manage conda packages, environments, and
channels without using command-line commands.
• Navigator can search for packages on Anaconda.org or in a local
Anaconda Repository.
• It is available for Windows, macOS, and Linux.
Anaconda Navigator
Jupyter Notebook
Jupyter Notebook
• The Jupyter Notebook is an open-source web application that allows
you to create and share documents that contain live code, equations,
visualizations and narrative text.
• Uses include: data cleaning and transformation, numerical simulation,
statistical modeling, data visualization, machine learning, and much
more.
Features of Jupyter Notebook
• Language of choice: Jupyter supports over 40 programming
languages, including Python, R, Julia, and Scala.
• Share notebooks: Notebooks can be shared with others using email,
Dropbox, GitHub and the Jupyter Notebook Viewer.
• Interactive output: Your code can produce rich, interactive output:
HTML, images, videos, LaTeX, and custom MIME types.
• Big data integration: Leverage big data tools, such as Apache Spark,
from Python, R and Scala. Explore that same data with pandas, scikit-
learn, ggplot2, TensorFlow.
Features of Jupyter Web Application
• In-browser editing for code, with automatic syntax highlighting,
indentation, and tab completion/introspection.
• The ability to execute code from the browser, with the results of
computations attached to the code which generated them.
• Displaying the result of computation using rich media representations, such
as HTML, LaTeX, PNG, SVG, etc. For example, publication-quality figures
rendered by the matplotlib library, can be included inline.
• In-browser editing for rich text using the Markdown markup language,
which can provide commentary for the code, is not limited to plain text.
• The ability to easily include mathematical notation within markdown cells
using LaTeX, and rendered natively by MathJax.
Notebook Document
• Notebook documents contains the inputs and outputs of an
interactive session as well as additional text that accompanies the
code but is not meant for execution.
• These documents are internally JSON files and are saved with the
.ipynb extension.
• Since JSON is a plain text format, they can be version-controlled and
shared with colleagues.
• Notebooks may be exported to a range of static formats, including
HTML (for example, for blog posts), reStructuredText, LaTeX, PDF, and
slide shows, via the nbconvert command.
Starting Notebook Server
• You can start running a notebook server from the command line using the
following command:
jupyter notebook
• This will print some information about the notebook server in your
console, and open a web browser to the URL of the web application (by
default, http://127.0.0.1:8888).
• The landing page of the Jupyter notebook web application, the dashboard,
shows the notebooks currently available in the notebook directory (by
default, the directory from which the notebook server was started).
• You can create new notebooks from the dashboard with the New
Notebook button, or open existing ones by clicking on their name.
Starting Notebook Server
• When starting a notebook server from the command line, you can also
open a particular notebook directly, bypassing the dashboard, with jupyter
notebook my_notebook.ipynb. The .ipynb extension is assumed if no extension is
given.
• When you are inside an open notebook, the File | Open… menu option will
open the dashboard in a new browser tab, to allow you to open another
notebook from the notebook directory or to create a new notebook.
• You can start more than one notebook server at the same time, if you want
to work on notebooks in different directories.
• By default the first notebook server starts on port 8888, and later notebook
servers search for ports near that one. You can also manually specify the
port with the --port option.
Create New Notebook Document
• A new notebook may be created at any time, either from the
dashboard, or using the File ‣ New menu option from within an active
notebook.
• The new notebook is created within the same directory and will open
in a new browser tab.
• It will also be reflected as a new entry in the notebook list on the
dashboard.
Create New Notebook Document
Notebook User Interface
• When you create a new notebook document, you will be presented with
the notebook name, a menu bar, a toolbar and an empty code cell.
• Notebook name: The name displayed at the top of the page, next to the
Jupyter logo, reflects the name of the .ipynb file.
• Clicking on the notebook name brings up a dialog which allows you to rename it.
Thus, renaming a notebook from “Untitled0” to “My first notebook” in the browser,
renames the Untitled0.ipynb file to My first notebook.ipynb.
• Menu bar: The menu bar presents different options that may be used to
manipulate the way the notebook functions.
• Toolbar: The tool bar gives a quick way of performing the most-used
operations within the notebook, by clicking on an icon.
• Code cell: the default type of cell; read on for an explanation of cells.
Notebook User Interface
Structure of Notebook Document
• The notebook consists of a sequence of cells.
• A cell is a multiline text input field, and its contents can be executed
by using Shift-Enter, or by clicking either the “Play” button the
toolbar, or Cell, Run in the menu bar.
• The execution behavior of a cell is determined by the cell’s type.
There are three types of cells: code cells, markdown cells, and raw
cells.
• Every cell starts off being a code cell, but its type can be changed by
using a drop-down on the toolbar (which will be “Code”, initially), or
via keyboard shortcuts.
Code Cell
• A code cell allows you to edit and write new code, with full syntax
highlighting and tab completion.
• The programming language you use depends on the kernel, and the default
kernel (IPython) runs Python code.
• When a code cell is executed, code that it contains is sent to the kernel
associated with the notebook.
• The results that are returned from this computation are then displayed in
the notebook as the cell’s output.
• The output is not limited to text, with many other possible forms of output
are also possible, including matplotlib figures and HTML tables (as used, for
example, in the pandas data analysis package).
• This is known as IPython’s rich display capability.
Markdown Cell
• You can document the computational process in a literate way, alternating descriptive
text with code, using rich text.
• In IPython this is accomplished by marking up text with the Markdown language.
• The corresponding cells are called Markdown cells. The Markdown language provides a
simple way to perform this text markup, that is, to specify which parts of the text should
be emphasized (italics), bold, form lists, etc.
• If you want to provide structure for your document, you can use markdown headings.
Markdown headings consist of 1 to 6 hash # signs # followed by a space and the title of
your section.
• The markdown heading will be converted to a clickable link for a section of the notebook.
It is also used as a hint when exporting to other document formats, like PDF.
• When a Markdown cell is executed, the Markdown code is converted into the
corresponding formatted rich text. Markdown allows arbitrary HTML code for formatting.
Raw Cell
• Raw cells provide a place in which you can write output directly. Raw
cells are not evaluated by the notebook.
Spyder IDE
Spyder IDE
• Spyder is a free and open-source scientific environment written in
Python, for Python, and designed by and for scientists, engineers and
data analysts.
• It features a unique combination of the advanced editing, analysis,
debugging, and profiling functionality of a comprehensive
development tool with the data exploration, interactive execution,
deep inspection, and beautiful visualization capabilities of a scientific
package.
Spyder
Spyder Editor
• Spyder’s multi-language Editor
integrates a number of
powerful tools right out of the
box for an easy to use,
efficient editing experience.
• The Editor’s key features
include syntax highlighting;
real-time code and style
analysis; on-demand
completion, calltips and go-to-
definition features; a
function/class browser,
horizontal and vertical
splitting, and much more.
IPython Console
• The IPython Console
allows you to execute
commands and enter,
interact with and visualize
data inside any number
of fully featured IPython
interpreters.
Spyder Variable Explorer
• The Variable Explorer allows
you to interactively browse
and manage the objects
generated running your
code.
Spyder Variable Explorer
• It shows the namespace
contents (including all
global objects, variables,
class instances and
more) of the currently
selected IPython
Console session, and
allows you to add,
remove, and edit their
values through a variety
of GUI-based editors.
Spyder Variable Explorer
• The Variable Explorer
gives you information on
the name, size, type and
value of each object. To
modify a scalar variable,
like a number, string or
boolean, simply double
click it in the pane and
type its new value.
Spyder Help Pane
• You can use the Help pane
to find, render and display
rich documentation for
any object with a
docstring, including
modules, classes,
functions and methods.
This allows you to access
documentation easily
directly from Spyder,
without having to
interrupt your workflow.
Spyder Plots
• The Plots pane shows the
static figures and images
created during your
session.
• It will show you plots from
the IPython Console,
produced by your code in
the Editor or generated by
the Variable Explorer
allowing you to interact
with them in several ways.
Spyder Plots
• The figures shown in the
Plots pane are those
associated with the
currently active Console
tab;
• if you switch consoles,
the list of plots displayed
(or none at all, if a new
console) will change
accordingly.
Spyder Files
• The Files pane is a
filesystem and directory
browser built right into
Spyder.
• You can view and filter
files according to their
type and extension,
open them with the
Editor or an external
tool, and perform many
common operations.
Spyder History Pane
• With the History pane,
you can view all the
commands you’ve
entered into any IPython
Console, along with their
timestamp.
Thanks
Samatrix Consulting Pvt Ltd