Python Programming
Dr. [Link]
Associate Professor – Department of Computer
Applications
Dr. N.G.P. ARTS AND SCIENCE COLLEGE
Dr. N.G.P.-KALAPATTI ROAD
COIMBATORE-641 048
Tamil Nadu, India
Mobile: +91 9841158445, E-mail: kavitha.k@[Link]
Dr.N.G.P. Arts and Science College 1
Coimbatore,Tamil Nadu, India
CONTENT TO BE DISCUSSED
Unit V – The pandas Library
An Introduction: The Python Data Analysis Library
Installation
• Installation from Anaconda
• Installation from PyPI
• Installation on Linux
• Installation from Source
A Module Repository for Windows
Test Your pandas Installation
Getting Started with pandas
Summary & Discussions 2
Unit V – Pandas
The pandas Library
An Introduction:The Python Data Analysis Library:
- “pandas” – is a fantastic Python Library
- Open source Python Library for highly specialized Data Analysis
- Designed & developed by Wes Mc Kinney in 2008
- Later his colleague Sien Chang in 2012 added to the development
- Designed on the basis of Numpy Library
- Provide all tools for the processing of the data, data extraction & data
manipulation
- Provide 2 new Data Structures: Series & Data Frames
- Also provides an extended set of functions & methods to perform
operations 3
Installation
- Easiest way to install pandas is by using Distributions
i) Installation from Anaconda:
To install the module pandas:
conda install pandas
Anaconda will check for dependencies & download pandas
To upgrade your package to newer version:
conda update pandas
ii) Installation from PyPI:
Pandas can also be installed by PyPI
4
pip install pandas
iii) Installation on Linux:
- Without using Distributions
On Debian & Ubuntu
sudo apt-get install python-pandas
On OpenSuse & Fedora
zypper in python-pandas
iv) Installation from Source:
- If you want to compile your module starting from source code, you can find it on the
Github
[Link]
git clone git://[Link]/pydata/[Link]
cd pandas
python [Link] install
- Make sure that Cython is installed at compile time 5
A Module Repository for Windows
- Christoph Gohlke’s Python Extension Packages for Windows
repository
- Is an online repository from where we can download third-party
modules.
([Link]/~gohlke/pythonlibs/)
- Each module is available in both 32 bit & 64 bit format
- Pip application is used to install the modules
pip install [Link]
- Choose the correct version of the module based on :
- Python version
- PC Architecture
6
Test your pandas Installation :
- After Installation, a test is done to check on the executability of its
internal controls.
Confirm that the module nose is installed in your Python Distribution
Then start the test by entering the code
nosetests pandas
Test runs for several minutes and at end, displays a list of problems
encountered
7
Getting started with pandas:
- First open a session on the Python Shell
- Then import panda Library
>>> import pandas as pd
>>> import numpy as np
Another method for importing:
>>> from pandas import *
- but not a good practice
8
9