Section 1
##### Getting Started with the most popular Data Science Library: Pandas

Section 2
##### Working with Pandas

1

Imputing missing values

2

Pivot tables

3

Crosstabs

4

Merge DataFrames

5

Sorting data frames

6

Plotting with Pandas

7

Analysis broken down into various steps

8

Exploratory Analysis

9

Basic Descriptive Statistic Analysis

10

Distribution Analysis

11

Categorical Variable Analysis

12

Data Munging

13

Treating Missing Values

Section 3
##### Building Predictive Models

1

Linear Regression Theory

2

Understanding Regression

3

Training and Validation

4

Goodness of Fit

5

Practical Application

6

Exploratory Analysis

7

Case study

8

Logistic Regression Theory

9

Linear Probability Model

10

Concept of Classification

11

Comparison with Linear Regression

12

Odds Ratio

13

Classification Table

14

Practical Application

15

Getting the data

16

Reading the data

17

Algorithms

18

Decision Tree

19

Random Forest

Section 4
##### Time Series Analysis

**Series in Python
**Series is a one-dimensional labeled array capable of holding data of any type (integer, string, float, python objects, etc.). The axis labels are collectively called index.

**pandas.Series
**A pandas Series can be created using the following constructor −

pandas.Series( data, index, dtype, copy)

The parameters of the constructor are as follows –

Sr.No |
Parameter & Description |

1 | Data
data takes various forms like ndarray, list, constants |

2 | Index
Index values must be unique and hashable, same length as data. Default |

3 | dtype
dtype is for data type. If None, data type will be inferred |

4 | copy
Copy data. Default False |

A series can be created using various inputs like −

*Array**Dict**Scalar value or constant*

**Create an Empty Series
**A basic series, which can be created is an Empty Series.

import pandas as pd

s = pd.Series()

print s

Its

Series([], dtype: float64)

**Create a Series from ndarray
**If data is an ndarray, then index passed must be of the same length. If no index is passed, then by default index will be

**Example 1
**#import the pandas library and aliasing as pd

import pandas as pd

import numpy as np

data = np.array([‘a’,’b’,’c’,’d’])

s = pd.Series(data)

print s

Its

0 a

1 b

2 c

3 d

dtype: object

We did not pass any index, so by default, it assigned the indexes ranging from 0 to

**Example 2
**#import the pandas library and aliasing as pd

import pandas as pd

import numpy as np

data = np.array([‘a’,’b’,’c’,’d’])

s = pd.Series(data,index=[100,101,102,103])

print s

Its

100 a

101 b

102 c

103 d

dtype: object

We passed the index values here. Now we can see the customized indexed values in the output.

**Create a Series from dict
**A

**Example 1
**#import the pandas library and aliasing as pd

import pandas as pd

import numpy as np

data = {‘a’ : 0., ‘b’ : 1., ‘c’ : 2.}

s = pd.Series(data)

print s

Its

a 0.0

b 1.0

c 2.0

dtype: float64

**Example 2
**#import the pandas library and aliasing as pd

import pandas as pd

import numpy as np

data = {‘a’ : 0., ‘b’ : 1., ‘c’ : 2.}

s = pd.Series(data,index=[‘b’,’c’,’d’,’a’])

print s

Its

b 1.0

c 2.0

d NaN

a 0.0

dtype: float64

**Create a Series from Scalar
**If data is a scalar value, an index must be provided. The value will be repeated to match the length of

import pandas as pd

import numpy as np

s = pd.Series(5, index=[0, 1, 2, 3])

print s

Its

0 5

1 5

2 5

3 5

dtype: int64

**Accessing Data from Series with Position
**Data in the series can be accessed similar to that in an

import pandas as pd

s = pd.Series([1,2,3,4,5],index = [‘a’,’b’,’c’,’d’,’e’])

#retrieve the first element

print s[0]

Its

1

**Example 2
**

s = pd.Series([1,2,3,4,5],index = [‘a’,’b’,’c’,’d’,’e’])

#retrieve the first three element

print s[:3]

Its

a 1

b 2

c 3

dtype: int64

**Example 3
**

s = pd.Series([1,2,3,4,5],index = [‘a’,’b’,’c’,’d’,’e’])

#retrieve the last three element

print s[-3:]

Its

c 3

d 4

e 5

dtype: int64

**Retrieve Data Using Label (Index)
**A Series is like a fixed-size

**Example 1
**

s = pd.Series([1,2,3,4,5],index = [‘a’,’b’,’c’,’d’,’e’])

#retrieve a single element

print s[‘a’]

Its

1

**Example 2
**

s = pd.Series([1,2,3,4,5],index = [‘a’,’b’,’c’,’d’,’e’])

#retrieve multiple elements

print s[[‘a’,’c’,’d’]]

Its

a 1

c 3

d 4

dtype: int64