Chapter 1 Review of Python Basicseng PDF
Chapter 1 Review of Python Basicseng PDF
By:
Neha Tyagi, PGT CS
KV no-5 2nd Shift, Jaipur
Jaipur Region
Python Pandas ( A Review)
• Data Processing is the most important part of Data
Analysis. Because data is not avaiable every time in
desired format.
• Before analyzing the data it needs various types of
processing like - Cleaning, Restructuring or merging
etc.
• There are many tools available in python to process
the data fast Like-Numpy, Scipy, Cython and Pandas.
• Pandas are built on the top of Numpy.
• In this chapter we will learn about the basic concepts
of Python Pandas Data Series and DataFrames
which we learnt in class -11.
संजीव भदौरिया, के० वव० बािाबंकी
Python Pandas
• Pandas is an open-source library of python providing high-performance
data manipulation and analysis tool using its powerful data structure.
• Pandas provides rich set of functions to process various types of data.
• During data analysis it is very important to make it confirm that you are
using correct data types otherwise you may face some unexpected
errors.
• Some of the pandas supporting data types are as follows -
Index
Index
Attribute Description
Series.index Returns index of the series
Series.values Returns ndarray
Series.dtype Returns dtype object of the underlying data
Series.shape Returns tuple of the shape of underlying data
Series.nbytes Return number of bytes of underlying data
Series.ndim Returns the number of dimention
Series.size Returns number of elements
Series.intemsize Returns the size of the dtype
Series.hasnans Returns true if there are any NaN
Series.empty Returns true if series object is empty
<objectName>[<start>:<stop>:<step >]
To change
individual value To change value in a
certain slice
Arithmetic operation is
possible on objects of
same index otherwise
will result as NaN.
To delete value of
index
It is a 2D Dictionary made up of
above given dictionaries.
Here, you can get an idea If keys of yr2015, yr2016 and yr2017 were
of how index and column different here then rows and columns of
name have assigned. dataframe would have increased and non-
matching rows and column would store
NaN.
Neha Tyagi, KV5 Jaipur, II Shift
Creation of Dataframe from 2D ndarray
See the
operation of the
rdiv carefully
www.pythontrends.wordpress.com