Chapter 9. The pandas Library Architecture

In this chapter, we examine the various libraries that are available to pandas' users. This chapter is intended to be a short guide to help the user navigate and find their way around the various modules and libraries that pandas provide. It gives a breakup of how the library code is organized, and it also provides a brief description on the various modules. It will be most valuable to users who are interested to see the inner workings of pandas underneath, as well as to those who wish to make contributions to the code base. We will also briefly demonstrate how you can improve performance using Python extensions. The various topics that will be discussed are as follows:

  • Introduction to pandas' library hierarchy
  • Description of pandas' modules and files
  • Improving performance using Python extensions

Introduction to pandas' file hierarchy

Generally, upon installation, pandas gets installed as a Python module in a standard location for third-party Python modules:

Platform

Standard installation location

Example

Unix/Mac OS

prefix/lib/pythonX.Y/site-packages

/usr/local/lib/python2.7/site-packages

Windows

prefixLibsite-packages

C:Python27Libsite-packages

The installed files follow a specific hierarchy:

  • pandas/core: This contains files for fundamental data structures such as Series/DataFrames and related functionality.
  • pandas/src: This contains Cython and C code for implementing fundamental algorithms.
  • pandas/io: This contains input/output tools (such as flat files, Excel, HDF5, SQL, and so on).
  • pandas/tools: This contains auxiliary data algorithms merge and join routines, concatenation, pivot tables, and more.
  • pandas/sparse: This contains sparse versions of Series, DataFrame, Panel and more.
  • pandas/stats: This contains linear and Panel regression, and moving window regression. This should be replaced by functionality in statsmodels.
  • pandas/util: This contains utilities, development, and testing tools.
  • pandas/rpy: This contains RPy2 interface for connecting to R.
..................Content has been hidden....................

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