Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Python Data Visualization

You're reading from  Mastering Python Data Visualization

Product type Book
Published in Oct 2015
Publisher
ISBN-13 9781783988327
Pages 372 pages
Edition 1st Edition
Languages

Table of Contents (16) Chapters

Mastering Python Data Visualization
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. A Conceptual Framework for Data Visualization 2. Data Analysis and Visualization 3. Getting Started with the Python IDE 4. Numerical Computing and Interactive Plotting 5. Financial and Statistical Models 6. Statistical and Machine Learning 7. Bioinformatics, Genetics, and Network Models 8. Advanced Visualization Go Forth and Explore Visualization Index

An overview of conda


Conda is a command line-tool that is responsible for managing environments and Python packages, rather than using pip. There are ways to query and search the packages, create new environments if necessary, and install and update Python packages into the existing conda environments. This command-line tool also keeps track of dependencies between packages and platform specifics, helping you to create working environments from different combinations of packages. To check the version of conda that is running, you can enter conda --version in Python and it will show, for example, conda 3.18.2 as the version.

A conda environment is a filesystem directory that contains a specific collection of conda packages. To begin using an environment, simply set the PATH variable to point it to its bin directory.

Here is an example of the package installation from the command line using conda:

$ conda install scipy

Fetching package metadata: ....
Solving package specifications: .
Package plan for installation in environment /Users/MacBook/anaconda:

The following packages will be downloaded:

    package                |       build
    ---------------------|-----------------
    flask-0.10.1         |       py27_1         129 KB
    itsdangerous-0.23    |       py27_0          16 KB
    jinja2-2.7.1         |       py27_0         307 KB
    markupsafe-0.18      |       py27_0          19 KB
    werkzeug-0.9.3       |       py27_0         385 KB

The following packages will be linked:

    package              |            build
    ---------------------|-----------------
    flask-0.10.1         |       py27_1
    itsdangerous-0.23    |       py27_0
    jinja2-2.7.1         |       py27_0
    markupsafe-0.18      |       py27_0
    python-2.7.5         |       2
    readline-6.2         |       1
    sqlite-3.7.13        |       1
    tk-8.5.13            |       1
    werkzeug-0.9.3       |       py27_0
    zlib-1.2.7           |       1

Proceed ([y]/n)? 

Any dependencies on the package that we are installing will be recognized, downloaded, and linked automatically.

Here is an example of package update from the command line using conda:

$ conda update matplotlib
Fetching package metadata: ....
Solving package specifications: .
Package plan for installation in environment /Users/MacBook/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    freetype-2.5.2             |                0         691 KB
    conda-env-2.1.4            |           py27_0          15 KB
    numpy-1.9.2                |           py27_0         2.9 MB
    pyparsing-2.0.3            |           py27_0          63 KB
    pytz-2015.2                |           py27_0         175 KB
    setuptools-15.0            |           py27_0         436 KB
    conda-3.10.1               |           py27_0         164 KB
    python-dateutil-2.4.2      |           py27_0         219 KB
    matplotlib-1.4.3           |       np19py27_1        40.9 MB
    ------------------------------------------------------------
                                           Total:        45.5 MB

The following NEW packages will be INSTALLED:

    python-dateutil: 2.4.2-py27_0    

The following packages will be UPDATED:

    conda:             3.10.0-py27_0    --> 3.10.1-py27_0   
    conda-env:       2.1.3-py27_0     --> 2.1.4-py27_0    
    freetype:   2.4.10-1         --> 2.5.2-0         
    matplotlib:     1.4.2-np19py27_0 --> 1.4.3-np19py27_1
    numpy:          1.9.1-py27_0     --> 1.9.2-py27_0    
    pyparsing:      2.0.1-py27_0     --> 2.0.3-py27_0    
    pytz:           2014.9-py27_0    --> 2015.2-py27_0   
    setuptools:     14.3-py27_0      --> 15.0-py27_0     

Proceed ([y]/n)?

In some cases, there are more steps involved in installing a package via conda. For instance, to install wordcloud, you will have to perform the steps given in this code:

#step-1 command
conda install wordcloud

Fetching package metadata: ....
Error: No packages found in current osx-64 channels matching: wordcloud

You can search for this package on Binstar with
# This only means one has to search the source location
binstar search -t conda wordcloud

Run 'binstar show <USER/PACKAGE>' to get more details:
Packages:
                          Name | Access       | Package Types   | 
     ------------------------- | ------------ | --------------- |
             derickl/wordcloud | public       | conda           |
Found 1 packages

# step-2 command
binstar show derickl/wordcloud

Using binstar api site https://api.binstar.org
Name:    wordcloud
Summary:
Access:  public
Package Types:  conda
Versions:
   + 1.0

To install this package with conda run:
conda install --channel https://conda.binstar.org/derickl wordcloud

# step-3 command
conda install --channel https://conda.binstar.org/derickl wordcloud

Fetching package metadata: ......
Solving package specifications: .
Package plan for installation in environment /Users/MacBook/anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cython-0.22                |           py27_0         2.2 MB
    django-1.8                 |           py27_0         3.2 MB
    pillow-2.8.1               |           py27_1         454 KB
    image-1.3.4                |           py27_0          24 KB
    setuptools-15.1            |           py27_1         435 KB
    wordcloud-1.0              |       np19py27_1          58 KB
    conda-3.11.0               |           py27_0         167 KB
    ------------------------------------------------------------
                                           Total:         6.5 MB

The following NEW packages will be INSTALLED:
    django:     1.8-py27_0
    image:      1.3.4-py27_0
    pillow:     2.8.1-py27_1
    wordcloud:  1.0-np19py27_1

The following packages will be UPDATED:
    conda:      3.10.1-py27_0 --> 3.11.0-py27_0
    cython:     0.21-py27_0   --> 0.22-py27_0
    setuptools: 15.0-py27_0   --> 15.1-py27_1



Finally, the following packages will be downgraded:

    libtiff:    4.0.3-0       --> 4.0.2-1

Proceed ([y]/n)? y

Anaconda is a free Python distribution for scientific computing. This distribution comes with Python 2.x or Python 3.x and 100+ cross-platform tested and optimized Python packages. Anaconda can also create custom environments that mix and match different Python versions.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}