Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Tuesday 23 May 2017

ANACONDA CHEAT SHEET





Why do I need Anaconda?

Installing Python from scratch is no joy. Many scientific packages require a specific version of Python or R computer language along with many dependencies. It's hard to keep packages from interacting with each other, and harder to keep them all updated. Anaconda makes getting and maintaining all these packages quick and easy.

What is Anaconda?

The open source version of Anaconda is an easy-to-install high performance Python and R distribution with a package manager, environment manager and collection of 720+ open source packages with free community support.

Then what is Miniconda?

It's Anaconda without the collection of 720 open source packages. With Miniconda you download only the packages you want with the conda command, "conda install PACKAGENAME"




 

Will it work on
Yes, Anaconda is available for Windows, OS X or Linux, 32- or 64-bit, 400 MB HD
my machine?
available. Miniconda same but needs only 3 MB HD.


Quick Install It
docs.continuum.io/anaconda/install


Get your conda
conda.pydata.org/docs/using/cheatsheet.html
cheat sheet



Take the test drive
conda.pydata.org/docs/test-drive.html



NOW PLAY WITH THE WORLD'S MOST AWESOME DATA SCIENCE PACKAGES

Packaged included in Anaconda 4+, or get with "conda install PACKAGENAME"



1.NumPy | numpy.org

N-dimensional array for numerical computation

2.SciPy | scipy.org

Collection of numerical algorithms and toolboxes, including signal processing and optimization

3.MatPlotLib | matplotlib.org

Plotting library for Python

4.Pandas | pandas.pydata.org Powerful Python data analysis toolkit

5.Seaborn | stanford.edu/~mwaskom/software/seaborn/ Statistical data visualization

6.Bokeh | bokeh.pydata.org Interactive web visualization library



7.SciKit-Learn | scikit-learn.org/stable

Python modules for machine learning and data mining

8.NLTK | nltk.org

Natural language toolkit

9.Notebook | jupyter.org

Web-based interactive computational environment combines code execution, rich text, mathematics, plots and rich media

10.             R essentials | conda.pydata.org/docs/r-with-conda.html R with 80+ of the most used R packages for data science
"conda install -c r r-essentials"



Follow us on Twitter @continuum.io and join the #AnacondaCrew!

Connect with other talented, like-minded data scientists and developers while contributing to the open source movement. Visit https://continuum.io/community
See full user documentation for Anaconda docs.continuum.io/anaconda

http://know.continuum.io/rs/387-XNW-688/images/Anaconda_CheatSheet.pdf?mkt_tok=eyJpIjoiWmprNE5UaGtOemMxTWpBeiIsInQiOiJmWEhPY2NFUE9TVWpVSG1qMHkrc3NvT0FIZVNTK0p6bUdaVkh3TitLQUJyYzVtMlZtQlRja3J2Y1ZSa1grVDVkc1VzY2dQb2NmVWF6eEh5eWFkcTlud2ZvM3JGSUkrVlRONzI3N3poSVwvdDliWUgxMFh1VXRQazBOaUdCWE9pUjUifQ%3D%3D


Continuum.io · info@continuum.io · 512-776-1066 8/30/2016

Setup python environment using anaconda and Jupyter







Anaconda is the leading open data science platform powered by Python. The open source version of Anaconda is a high performance distribution of Python and R and includes over 100 of the most popular Python, R and Scala packages for data science.
Additionally, you'll have access to over 720 packages that can easily be installed with conda, our renowned package, dependency and environment manager, that is included in Anaconda. See the packages included with Anaconda and the Anaconda changelog

1.What is the Jupyter Notebook?

In this page briefly introduce the main components of the Jupyter Notebook environment. For a more complete overview see References.

1.1. Notebook document

Notebook documents (or “notebooks”, all lower case) are documents produced by the Jupyter Notebook App, which contain both computer code (e.g. python) and rich text elements (paragraph, equations, figures, links, etc...). Notebook documents are both human-readable documents containing the analysis description and the results (figures, tables, etc..) as well as executable documents which can be run to perform data analysis.

1.2. Jupyter Notebook App

The Jupyter Notebook App is a server-client application that allows editing and running notebook documents via a web browser. The Jupyter Notebook App can be executed on a local desktop requiring no internet access (as described in this document) or can be installed on a remote server and accessed through the internet.
In addition to displaying/editing/running notebook documents, the Jupyter Notebook App has a “Dashboard” (Notebook Dashboard), a “control panel” showing local files and allowing to open notebook documents or shutting down their kernels.

1.3. kernel

A notebook kernel is a “computational engine” that executes the code contained in a Notebook document. The ipython kernel, referenced in this guide, executes python code. Kernels for many other languages exist (official kernels).
When you open a Notebook document, the associated kernel is automatically launched. When the notebook is executed (either cell-by-cell or with menu Cell -> Run All), the kernel performs the computation and produces the results. Depending on the type of computations, the kernel may consume significant CPU and RAM. Note that the RAM is not released until the kernel is shut-down.

1.4. Notebook Dashboard

The Notebook Dashboard is the component which is shown first when you launch Jupyter Notebook App. The Notebook Dashboard is mainly used to open notebook documents, and to manage the running kernels (visualize and shutdown).
The Notebook Dashboard has other features similar to a file manager, namely navigating folders and renaming/deleting files.

2. Installation

2.1. Step 0: The browser

Step “zero” consists in installing a modern standard-compliant browser. Either Mozilla Firefox or Google Chrome will work well. Try to avoid MS Explorer.

2.2. Step 1: Installation

The easiest way to install the Jupyter Notebook App consists in installing a scientific python distribution which includes it. In this guide, we will use the Anaconda distribution created by Continuum. Note that Anaconda currently (mid 2015) still uses the old name IPython Notebook instead of Jupyter Notebook App but the software is the same.
  • Download Continuum Anaconda (free version, approx. 400MB), python 3, 64 bits.
  • Install it using the default settings for a single user.

3. Running the Jupyter Notebook

3.1. Launching Jupyter Notebook App

The Jupyter Notebook App can be launched by clicking on the Jupyter Notebook icon installed by Anaconda in the start menu (Windows) or by typing in a terminal (cmd on Windows):
jupyter notebook
This will launch a new browser window (or a new tab) showing the Notebook Dashboard, a sort of control panel that allows (among other things) to select which notebook to open.
When started, the Jupyter Notebook App can access only files within its start-up folder (including any sub-folder). If you store the notebook documents in a subfolder of your user folder no configuration is necessary. Otherwise, you need to choose a folder which will contain all the notebooks and set this as the Jupyter Notebook App start-up folder.
See below for platform-specific instructions on how to start Jupyter Notebook App in a specific folder.

3.1.1. Change Jupyter Notebook startup folder (Windows)

  • Copy the Jupyter Notebook launcher from the menu to the desktop.
  • Right click on the new launcher and change the “Start in” field by pasting the full path of the folder which will contain all the notebooks.
  • Double-click on the Jupyter Notebook desktop launcher (icon shows [IPy]) to start the Jupyter Notebook App, which will open in a new browser window (or tab). Note also that a secondary terminal window (used only for error logging and for shut down) will be also opened. If only the terminal starts, try opening this address with your browser: http://localhost:8888/.

3.1.2. Change Jupyter Notebook startup folder (OS X)

To launch Jupyter Notebook App:
  • Click on spotlight, type terminal to open a terminal window.
  • Enter the startup folder by typing cd /some_folder_name.
  • Type jupyter notebook to launch the Jupyter Notebook App (it will appear in a new browser window or tab).

3.2. Shut down the Jupyter Notebook App

In a nutshell, closing the browser (or the tab) will not close the Jupyter Notebook App. To completely shut it down you need to close the associated terminal.
In more detail, the Jupyter Notebook App is a server that appears in your browser at a default address (http://localhost:8888). Closing the browser will not shut down the server. You can reopen the previous address and the Jupyter Notebook App will be redisplayed.
You can run many copies of the Jupyter Notebook App and they will show up at a similar address (only the number after ”:”, which is the port, will increment for each new copy). Since with a single Jupyter Notebook App you can already open many notebooks, we do not recommend running multiple copies of Jupyter Notebook App.

3.3. Close a notebook: kernel shut down

When a notebook is opened, its “computational engine” (called the kernel) is automatically started. Closing the notebook browser tab, will not shut down the kernel, instead the kernel will keep running until is explicitly shut down.
To shut down a kernel, go to the associated notebook and click on menu File -> Close and Halt. Alternatively, the Notebook Dashboard has a tab named Running that shows all the running notebooks (i.e. kernels) and allows shutting them down (by clicking on a Shutdown button).

3.4. Executing a notebook

Download the notebook you want to execute and put it in your notebook folder (or a sub-folder of it).
Then follow these steps:
  • Launch the Jupyter Notebook App (see previous section).
  • In the Notebook Dashboard navigate to find the notebook: clicking on its name will open it in a new browser tab.
  • Click on the menu Help -> User Interface Tour for an overview of the Jupyter Notebook App user interface.
  • You can run the notebook document step-by-step (one cell a time) by pressing shift + enter.
  • You can run the whole notebook in a single step by clicking on the menu Cell -> Run All.
  • To restart the kernel (i.e. the computational engine), click on the menu Kernel -> Restart. This can be useful to start over a computation from scratch (e.g. variables are deleted, open files are closed, etc...).
More information on editing a notebook:


Azure AzCopy Command in Action

Azure AzCopy Command  in Action -  Install - Module - Name Az - Scope CurrentUser - Repository PSGallery - Force # This simple PowerShell ...