Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Exploratory Analysis

In this section we will explore data associated with climate vulnerability assessment of a river
basin system. At the end of this section of chapter you will be able to;

1. Import pandas libraries and perform basic time series analysis


2. Subset the time series data for different time frames
3. Calculate Summary Statistics and export to a csv file

First step towards performing climate vulnerability assessment of a river basin system is to
explore the historical data for the system under consideration. We will scan through the inflow
data at the sukkur barrage. The objectives of this part are to; i) Calculate the Descriptive
statistics; and ii) Perform drought analysis using deviation method.
We will use pandas package in python (http://pandas.pydata.org/) to perform the analysis. The
first step to move forwards is to get started with pandas and get use to of the functions that can
help us to explore the flow time series.
Getting started [30 mins]
Steps below will help you to get familiarize with the functions in pandas package. You will use
these functions for perform the task to achieve the objectives.

 Open PyCharm Edu IDE


 Create a New Project (File -> New Project..)
o Select the folder lower Indus
o Make sure that the interpreter in Python34
 Open Script getStart.py

97
 Now in Step 01 write the following code, you only have to write that do not have # in
start. This will import all required functions from the packages required for this exercise

 Now in Step 02 write the following code. This will import data file and index the dates as
unique values

98
 Now in Step 03 write the following code. This will let you to print data and plot the time
series and save it as a figure

 Now in Step 04 write the following code. This will let you to calculate the summary
statistics and individual statistical parameters

 Now in Step 05 write the following code. This will let you to query and create new
columns in data frame

 Now in Step 06 write the following code. This will let you group the data by year

99
Task # 1 [30 mins]
Calculate the following statistical parameters for each year for the given dataset.
Min Max Range Mean Stdev Skew

By looking at the table please answer;


1. How significant is the change in mean annual inflows. List year where the mean values
are significantly higher than others
2. Which year seems to deviate from mean
3. Which has the highest peak value.
4. Which year has lowest inflow
Open Task1.py for guidelines. Write the script in Task1.py and save.

100
Task # 2 [30 mins]
Perform drought analysis using deviation method and fill the following table;

S.No Years No of Years


1 Wet Years
2 Normal Years
3 Slight Drought
4 Moderate Drought
5 Severe Drought
Deviation method
1. Calculate the Mean Annual flows
2. Calculate the deviation from mean

 Q  Qmean 
Dev    100
 Qmean 
3. Use following criteria to decide the years
S. No Years Deviation Range

1 Wet Years > 10

2 Normal Years 10 to -10

3 Slight Drought -10 to -25


4 Moderate Drought -25 to -50
5 Severe Drought < -50

Open Task2.py for guidelines. Write the script in Task2.py and save.

101

You might also like