Chapter 2. Installing pandas

In this chapter, we will cover how to install pandas using the Anaconda Scientific Python distribution from Continuum Analytics. Anaconda is a popular Python distribution with both free and paid components, and it has cross-platform support—including Windows, Mac, and Linux. The base distribution installs pandas as part of the default installation, so it makes getting started with pandas simple.

The chapter will examine installing both pandas and Python through Anaconda, as this book assumes that you are new to both pandas and Python. This can include readers who are coming from an R environment to learn data manipulation skills using pandas. Those who already have more advanced Python skills can feel free to move onto later chapters or use alternative Python distributions and package managers, as well as virtualized development environments for multiple Python distributions.

In general, the remaining chapters of this book will focus on data manipulation with pandas. The examples can be run in any Python/pandas environment. Emphasis will not be towards learning Python programming. In fact, it is amazing how much you can do with just pandas statements in any Python / Ipython / IPython Notebook environment without performing much Python programming at all.

The default installation of Anaconda also installs an IPython Notebook server that can be used interactively to run the examples as well as the notebooks provided with the source of the book. IPython Notebooks are an excellent means of creating pandas applications, as well as sharing them with others on the Web. We will briefly cover starting this server and using IPython Notebooks.

An alternative to installing Python and pandas is through the use of an online Wakari account. Wakari is a web-based IPython Notebook service that has pandas installed by default and provides excellent capabilities for sharing Python applications online. Creating and getting started with Wakari will have its own brief exposition.

We will cover the following topics in this chapter:

  • Getting Anaconda (and pandas)
  • Installing Anaconda on Linux, Mac, and Windows
  • Verifying the version of pandas
  • Updating the pandas packages within Anaconda with conda
  • Running a small pandas sample in IPython
  • Starting the IPython Notebook server
  • Installing and running the workbooks for the textbook
  • Using Wakari for pandas

Getting Anaconda

We will focus on installing Anaconda Python and ensuring that pandas is up to date within that distribution. You are not limited to using pandas with Anaconda, as pandas is supported by most Python distributions—although the specific installation tasks on each distribution may differ from those covered in this chapter. If you use another Python distribution, feel free to use your package manager of choice or pip from PyPI.

Note

I would say most Python distributions because—being a Mac user—I've found it very difficult (if not impossible) to install pandas into the default Python provided in OS X by Apple.

At the time of writing, pandas is at Version 0.15.1. The current version of Anaconda is 2.1.9 that contains Python 2.7.8, but comes with pandas 0.14.1 by default. Therefore, we will update to v0.15.1 using the conda package manager provided by Anaconda.

Anaconda Python can be downloaded from the Continuum Analytics website at http://continuum.io/downloads. The web server will identify the browser's operating system and present you with an appropriate software download file for that platform. The following screenshot shows the download page when running on Ubuntu 13.10:

Getting Anaconda

Linux users are presented with a download for a shell script to download and execute, and graphical installers are available for Windows and Mac platforms. Download the package for your platform, and then proceed to the appropriate section for installation details.

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

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