Ensuring pandas is up to date

Now that Anaconda is installed, we can check the version of pandas that is installed either from within the Python interpreter or from the command line. The means to perform both of these is the same on each platform, and this will be demonstrated from an OS X terminal.

From within the Anaconda Python interpreter, you can check the version of pandas on the system by importing pandas and then examining the version with the following two Python statements:

>>>import pandas as pd
>>>print (pd.__version__)

The preceding commands will then report the version of pandas. The following screenshot shows that v0.14.1 is the currently installed version:

Ensuring pandas is up to date

This has reported that pandas version is 0.14.1, which is not the most recent, so we may want to update.

You can also check the pandas version using the conda package manager from the command line as follows (which also reports that version is 0.14.1):

Michaels-MacBook-Pro:~ michaelheydt$ conda list pandas
# packages in environment at //anaconda:
#
pandas                    0.14.1               np19py27_0  
Michaels-MacBook-Pro:~ michaelheydt$ 

To update pandas to the most recent version, use the following conda command:

Michaels-MacBook-Pro:~ michaelheydt$ conda update pandas
Fetching package metadata: ..
Solving package specifications: .
Package plan for installation in environment //anaconda:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-3.7.3                |           py27_0         156 KB
    numpy-1.9.1                |           py27_0         2.9 MB
    pandas-0.15.1              |       np19py27_0         4.6 MB
    pytz-2014.9                |           py27_0         175 KB
    requests-2.5.0             |           py27_0         586 KB
    setuptools-7.0             |           py27_0         436 KB
    ------------------------------------------------------------
                                           Total:         8.8 MB

The following packages will be UPDATED:

    conda:      3.7.0-py27_0      --> 3.7.3-py27_0     
    numpy:      1.9.0-py27_0      --> 1.9.1-py27_0     
    pandas:     0.14.1-np19py27_0 --> 0.15.1-np19py27_0
    pytz:       2014.7-py27_0     --> 2014.9-py27_0    
    requests:   2.4.1-py27_0      --> 2.5.0-py27_0     
    setuptools: 5.8-py27_0        --> 7.0-py27_0       

Proceed ([y]/n)? 

We can see that pandas can be updated to v0.15.1, along with all required dependent packages. Press Enter to proceed. The conda package manager will retrieve and install the required packages:

Fetching packages ...
conda-3.7.3-py 100% |##############################| Time: 0:00:00 353.91 kB/s
numpy-1.9.1-py 100% |##############################| Time: 0:00:04 711.95 kB/s
pandas-0.15.1- 100% |##############################| Time: 0:00:06 733.99 kB/s
pytz-2014.9-py 100% |##############################| Time: 0:00:00 373.63 kB/s
requests-2.5.0 100% |##############################| Time: 0:00:01 336.99 kB/s
setuptools-7.0 100% |##############################| Time: 0:00:00 571.84 kB/s
Extracting packages ...
[      COMPLETE      ] |################################################| 100%
Unlinking packages ...
[      COMPLETE      ] |################################################| 100%
Linking packages ...
[      COMPLETE      ] |################################################| 100%
Michaels-MacBook-Pro:~ michaelheydt$ 

You can check whether pandas v0.15.1 is installed with conda:

Michaels-MacBook-Pro:~ michaelheydt$ conda list pandas
# packages in environment at //anaconda:
#
pandas                    0.15.1               np19py27_0  
Michaels-MacBook-Pro:~ michaelheydt$ 

The pandas library is now updated. This can also be verified from within the Python interpreter as shown in the following screenshot:

Ensuring pandas is up to date
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.172.130