Chapter 2. Installation of pandas and the Supporting Software

Before we can start work on pandas for doing data analysis, we need to make sure that the software is installed and the environment is in proper working order. This section deals with the installation of Python (if necessary), the pandas library, and all necessary dependencies for the Windows, Mac OS X, and Linux platforms. The topics we address include the following:

  • Selecting a version of Python
  • Installing Python
  • Installing pandas (0.16.0)
  • Installing IPython and Virtualenv

The steps outlined in the following section should work for the most part, but your mileage may vary depending upon the setup. On different operating system versions, the scripts may not always work perfectly, and the third-party software packages already in the system may sometimes conflict with the provided instructions.

Selecting a version of Python to use

Before proceeding with the installation and download of Python and pandas, we need to consider the version of Python we're going to use. Currently, there are two versions flavors of Python in current use, namely Python 2.7.x and Python 3. If the reader is new to Python as well as pandas, the question becomes which version of the language he/she should adopt.

On the surface, Python 3.x would appear to be the better choice since Python 2.7.x is supposed to be the legacy, and Python 3.x is supposed to be the future of the language.

Note

For reference, you can go through the documentation on this with the title Python2orPython3 at https://wiki.python.org/moin/Python2orPython3.

The main differences between Python 2.x and 3 include better Unicode support in Python 3, print and exec changed to functions, and integer division. For more details, see What's New in Python 3.0 at http://docs.python.org/3/whatsnew/3.0.html.

However, for scientific, numeric, or data analysis work, Python 2.7 is recommended over Python 3 for the following reason: Python 2.7 is the preferred version for most current distributions and the support for Python 3.x was not as strong for some libraries, although that is increasingly becoming less of an issue.

For reference, have a look at the documentation titled Will Scientists Ever Move to Python 3? at http://bit.ly/1DOgNuX. Hence, this book will use Python 2.7. It does not preclude the use of Python 3, and developers using Python 3 can easily make the necessary code changes to the examples by referring to the following documentation: Porting Python 2 Code to Python 3 at http://docs.python.org/2/howto/pyporting.html.

..................Content has been hidden....................

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