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

APPROVAL SHEET

This feasibility study titled “THE STUDY OF EARTHQUAKE DATA FROM

1965-2016” , prepared and submitted by JASMER SINGH of 4BCOMH-B and


SUNGKWON KIM of 4CMS in partial fulfilment of the requirements of the certificate
course “Research and Data Analysis Using Python”, has been examined and is recommended
for acceptance and approval.

----------------------------------------

Centre for Advanced Research and Training (CART)

Christ (Deemed to be University)

Bengaluru
CERTIFICATE

This is to certify that Mr. JASMER SINGH (1611118) of 4BCOMH-B and SUNGKWON
KIM (1640214) of 4CMS, Christ (Deemed to be University), Bengaluru, India, have
completed their research project titled “THE STUDY OF EARTHQUAKE DATA FROM

1965-2016”. They have submitted their report for the partial fulfilment of the certificate
course “Research and Data Analysis Using Python” from Christ (Deemed to be University)
DECLARATION

We hereby declare that the project work entitled “THE STUDY OF EARTHQUAKE

DATA FROM 1965-2016” to the university is a record of original work done by us


under the guidance of Professor Rinju George and Purusharth Saxena. This project was not
performed as the basis for the award of any degree.

JASMER SINGH (1611118)

SUNGKWON KIM (1640214)


ACKNOWLEDGEMENT

We would like to thank our certificate course incharge Professor Rinju George of Centre for
Advanced Research and Training at Christ (Deemed to be University), Bengaluru. We would
also like to thank our certificate course teacher Purusharth Saxena and Raghuttam Hombal
who guided us and were a constant support throughout the duration of this project.
TABLE OF CONTENTS

Approval sheet i

Certificate ii

Declaration iii

Acknowledgement iv

CHAPTER 1
INTRODUCTION

1.1 Introduction

1.2 Need for the Study

CHAPTER 2
REVIEW OF RELATED LITERATURE

2.1 Introduction to Literature Review


2.2 Overview of the Literature Reviewed

CHAPTER 3 METHODOLOGY

3.1 Introduction

3.2 Method of Study

3.3 Objectives of the Study

3.4 Variables of the Study


3.5 Hypotheses of the Study

3.6 Sample of the Study

3.6.1 Population of the Study

3.6.2 Selection of the Sample

3.7 Tool of the Study

3.7.1 Validation of the Tool

3.8 Statistical Analysis of the Study

CHAPTER IV

DATA ANALYSIS AND INTERPRETATION

4.1 Introduction

4.2 Section 1: Descriptive Statistics

4.3 Section 2: Inferential Statistics

4.4 Section 3: Qualitative Analysis

CHAPTER V

SUMMARY AND CONCLUSIONS

5.1 A Brief Report of the Work carried out


5.2 Findings of the Study

5.3 Implications of the Study

5.4 Scope for Future Work

5.5 Limitations of the Study

5.6 Conclusion

The CODE

References
THE STUDY OF EARTHQUAKE DATA FROM 1965-2016

CHAPTER-1

INTRODUCTION

1.1 Introduction

Movements within the Earth’s crust cause stress to build up at points of weakness and rocks
to deform.

Stored energy builds up in the same way as energy builds up in the spring of a watch when it
is wound.

When the stress finally exceeds the strength of the rock, the rock fractures along a fault, often
at a zone of existing weakness within the rock. The stored energy that is suddenly released is
known as an earthquake!

Intense vibrations, or seismic waves, spread out from the initial point of rupture, the focus,
like ripples on a pond. These waves are what makes the ground shake and can travel large
distances in all directions. Near the focus, the waves can be very large, making them
extremely destructive. (Friedl, n.d.)

1.2 Need for the Study

Earthquakes have many aspects to study - its size, location, waveform, damage pattern,
causative factor, distribution pattern and after-effects. Every aspect has its own importance.

Through observing and analyzing seismic events, seismologists (scientists who study the
seismic waves created by movements in the Earth's crust) seek ways to lessen the effects of
earthquakes. Geophysics and seismology, like environmental science, deal ultimately with
the interconnectedness of humans and the natural world. Since its inception in the mid-
1800s, seismology has used increasingly advanced instrumentation and methods of analysis
to measure the magnitude of seismic waves. Seismologists have learned where earthquakes
are likely to occur and how to engineer earthquake-resistant structures. (William Spence,
1989) (William Spence, USGS, 1989)

By studying the size and location, we can decipher the origin and frequency of occurrence in
terms of its size and spatial-temporal distribution. This will enable us to classify the area into
seismic zone in terms of earthquake proneness. This is the area of interest for geophysicists.

CHAPTER 2

REVIEW OF RELATED LITERATURE

2.1 Introduction to Literature Review


The current studies and findings with regards to earthquakes are few. It is nearly impossible
to determine the exact time and date of the occurrence of potential earthquakes. However, it
is possible to reduce the damage caused by extensive planning and researching into the
specifics of earthquakes.

2.2 Overview of the Literature Reviewed

The National Earthquake Information Centre (NEIC), USA, compiles and provides to
scientists and to the public an extensive seismic database that serves as a foundation for
scientific research through the operation of modern digital national and global seismograph
networks and cooperative international agreements. A dataset procured from NEIC was used
to carry out the research which includes a record of the date, time, location, depth, magnitude,
and source of every earthquake with a reported magnitude 5.5 or higher from 1965-2016.
(Futurist, 2016)
CHAPTER 3

METHODOLOGY

3.1 Introduction

A dataset from the NEIC was used as the sole source of information for analyzing data
pertinent to earthquakes. (Futurist, 2016)

3.2 Method of Study

The data was reviewed and analyzed using Python 3.6.4.

The NumPy module was used.

3.3 Objectives of the Study

To determine relations between depth and magnitude.

To see if there has been an increase in earthquake occurrences from the 20th to the 21st
century.

3.4 Variables of the Study

Depth

Magnitude

Number of earthquakes.

3.5 Hypotheses of the Study

a) H0 = There exists a relationship between the time and occurrences of earthquakes.

H1 = There is no relationship between the time and occurrences of earthquakes.


b) H0 = There exists a relationship between the depth and magnitude of earthquakes.

H1 = There is no relationship between the depth and magnitude of earthquakes.

3.6 Sample of the Study

3.6.1 Population of the Study

The population is derived from the entire dataset, which is a complete list of earthquakes
from around the world which have occurred in the time frame of 1965-2016, with a
magnitude of more than 5.5.

3.6.2 Selection of the Sample

Complete data pertaining to earthquakes before 1965 was not found easily, which is why a
sample of 50 years from 1965-2016 has been taken to perform the research.

3.7 Tool of the Study

Python 3.6.4 was used for the analysis of the data. Several modules/tools were used within
python including NumPy, Pandas, MatPlotLib, Json.

3.7.1 Validation of the Tool

Python is one of the most trusted languages for data analysis. It is an externally valid
instrument which helps obtain a strong population generalizability (i.e. the degree to which a
sample represents the population). (Biddix, n.d.)
3.8 Statistical Analysis of the Study

Statistical tools used include correlation, mean, median, mode, range, graphs and scatterplot
diagrams.

CHAPTER IV

DATA ANALYSIS AND INTERPRETATION

4.1 Introduction

The data of the earthquake have collected and was analysis in purpose for the project. This
include various methodology to give a statistical idea about earthquakes.

This data analysis will prove try to prove the two hypothesis and give an idea about
earthquakes.

Earthquakes with magnitudes more than 5.5 were considered in the database as it is a
magnitude which can actually give damage.

This database, consisting of 23411 data and has various variables, was collected from NEIC
via Kaggle.

4.2 Section 1: Descriptive Statistics

Descriptive statistics were focused on the variable “Magnitude” in order to give the idea
about the power of earthquakes.

Mean-5.88253075346

Mode-5.5
This implies that Smaller magnitude that earthquake is much more than the strong magnitude
Earthquakes.
Max-9.1
The highest magnitude Earthquake recorded in the database is 9.1

Standard deviation-0.423065639316

Variance-0.17898453517

4.3 Section 2: Inferential Statistics

Correlation is taken between Magnitude and Depth, which we considered to have relations.

It had correlation of 0.02345731.

array ([[ 1. , 0.02345731,

0.02345731, 1. ]])

Which indicates that it has positive correlation i.e. if depth is more then there is more
magnitude. And vice-verse.

And the scatter plot shown us random correlation where we can see various aspects.

Overall It shows the positive correlation but when we take half (i.e. 350), it show negative
and further you go it will show positive correlation.

Therefore we can conclude that For less Depth, it will show negative correlation but when
certain depth is set it will show the positive.

Hence we can conclude that it had random correlation but we can find the trend of the graph.

H0 = There exists a relationship between the depth and magnitude of earthquakes.

There is relationship between magnitude and depth of Earthquakes but with weak correlation.

But when we divide magnitude section wise we can see the strong correlation and positive or
negative correlation.

Hence the there is clear relationship between Magnitude and Depth.


4.4 Section 3: Quantitative Analysis

The number of the earthquakes has been taken as the Quantitative analysis of the project.

We have made the Data frame in order to see the number of earthquakes occurring
throughout the world with respect to time (in years).

We found out that it was showing standard deviation of 91.088348.

H0 = There exists a relationship between the time and occurrences of earthquakes.

Therefore from the graph we can conclude the hypothesis that time and occurrence of
earthquake have relations i.e. as time passed there is more occurrence of Earthquakes.

CHAPTER V

SUMMARY AND CONCLUSIONS

5.1 A Brief Report of the Work carried out

It is important to study earthquake patterns for risk management and limiting damage to life
and property. The study was carried out on earthquakes and the related variables to confirm
the hypotheses. Using Python for the data analysis, various statistical tools were employed to
get results and to verify them.

5.2 Findings of the Study

The study we have learned various aspect of the earthquake in from the General knowledge
aspect to statistical data analysis by python.

The study shows that there are various significance that is to be analysis. We have found that
even simple data analysis we could form a hypothesis and assumption.

The study gave brief idea of earthquake and able us to observe the certain results.

5.3 Implications of the Study


Implications can be made in various ways. From the analysis we have concluded that there is
increment of the earthquake over decades. This urges us to research more on and about this
topic and form a solution to avoid disaster.

And also we have concluded that Depth and Magnitude have correlation which we can
further study to prevent major damage from earthquake effects.

Furthermore we can do further analysis of database to draw the result which can help our
society from the negative effects of Earthquake.

5.4 Scope for Future Work

It is possible through more detailed work and employing thorough data mining techniques, to
gather more information and get more patterns for more meaningful work to be carried out
and for better observations.

5.5 Limitations of the Study

A time frame of only 60 years was taken. A better analysis may have been possible with data
on more years.

Only two relationships were studied. A more extensive study involving more variables could
have been carried out.

5.6 Conclusion

The study above proved both the hypotheses mentioned. Earthquakes have been increasing
throughout the years. This demands for a study in the qualitative aspects of the earth and
how we can prevent the rise in occurrence. The correlation between depth and magnitude
symbolizes that areas prone to more earthquakes should take special care in construction
work and safety measures. (Is there a correlation between the earthquake's magnitude and its
depth?, n.d.)
The CODE

import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

pwd

'/home/kimmy/다운로드'

database = pd.read_csv("/home/kimmy/다운로드/database.csv")

keep_col = ['Date', 'Latitude', 'Longitude', 'Depth', 'Depth Error', 'Magnitude', 'Magnitude


Error', 'Horizontal Distance', 'Horizontal Error', 'Root Mean Square', 'ID']
new_f = database[keep_col]
new_f.to_csv("database1.csv", index=False)
new_f

R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

N
01/02/19 Na Na ISCGEM86
0 19.2460 145.6160 131.60 NaN 6.0 NaN a
65 N N 0706
N
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

N
01/04/19 Na Na ISCGEM86
1 1.8630 127.3520 80.00 NaN 5.8 NaN a
65 N N 0737
N

N
01/05/19 Na Na ISCGEM86
2 -20.5790 -173.9720 20.00 NaN 6.2 NaN a
65 N N 0762
N

N
01/08/19 Na Na ISCGEM86
3 -59.0760 -23.5570 15.00 NaN 5.8 NaN a
65 N N 0856
N

N
01/09/19 Na Na ISCGEM86
4 11.9380 126.4270 15.00 NaN 5.8 NaN a
65 N N 0890
N

N
01/10/19 Na Na ISCGEM86
5 -13.4050 166.6290 35.00 NaN 6.7 NaN a
65 N N 0922
N

N
01/12/19 Na Na ISCGEM86
6 27.3570 87.8670 20.00 NaN 5.9 NaN a
65 N N 1007
N

N
01/15/19 Na Na ISCGEM86
7 -13.3090 166.2120 35.00 NaN 6.0 NaN a
65 N N 1111
N
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

N
01/16/19 Na Na ISCGEMS
8 -56.4520 -27.0430 95.00 NaN 6.0 NaN a
65 N N UP861125
N

N
01/17/19 Na Na ISCGEM86
9 -24.5630 178.4870 565.00 NaN 5.8 NaN a
65 N N 1148
N

N
1 01/17/19 Na Na ISCGEM86
-6.8070 108.9880 227.90 NaN 5.9 NaN a
0 65 N N 1155
N

N
1 01/24/19 Na Na ISCGEM86
-2.6080 125.9520 20.00 NaN 8.2 NaN a
1 65 N N 1299
N

N
1 01/29/19 Na Na ISCGEM86
54.6360 161.7030 55.00 NaN 5.5 NaN a
2 65 N N 1461
N

N
1 02/01/19 Na Na ISCGEM85
-18.6970 -177.8640 482.90 NaN 5.6 NaN a
3 65 N N 9136
N

N
1 02/02/19 Na Na ISCGEM85
37.5230 73.2510 15.00 NaN 6.0 NaN a
4 65 N N 9164
N
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

N
1 02/04/19 Na Na ISCGEM85
-51.8400 139.7410 10.00 NaN 6.1 NaN a
5 65 N N 9200
N

N OFFICIAL
1 02/04/19 Na Na
51.2510 178.7150 30.30 NaN 8.7 NaN a 196502040
6 65 N N
N 50122_30

N
1 02/04/19 Na Na ISCGEMS
51.6390 175.0550 30.00 NaN 6.0 NaN a
7 65 N N UP859215
N

N
1 02/04/19 Na Na ISCGEM85
52.5280 172.0070 25.00 NaN 5.7 NaN a
8 65 N N 9221
N

N
1 02/04/19 Na Na ISCGEM85
51.6260 175.7460 25.00 NaN 5.8 NaN a
9 65 N N 9222
N

N
2 02/04/19 Na Na ISCGEMS
51.0370 177.8480 25.00 NaN 5.9 NaN a
0 65 N N UP859230
N

N
2 02/04/19 Na Na ISCGEM85
51.7300 173.9750 20.00 NaN 5.9 NaN a
1 65 N N 9231
N
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

N
2 02/04/19 Na Na ISCGEM85
51.7750 173.0580 10.00 NaN 5.7 NaN a
2 65 N N 9233
N

N
2 02/04/19 Na Na ISCGEMS
52.6110 172.5880 24.00 NaN 5.7 NaN a
3 65 N N UP859241
N

N
2 02/04/19 Na Na ISCGEM85
51.8310 174.3680 31.80 NaN 5.7 NaN a
4 65 N N 9252
N

N
2 02/04/19 Na Na ISCGEM85
51.9480 173.9690 20.00 NaN 5.6 NaN a
5 65 N N 9261
N

N
2 02/04/19 Na Na ISCGEM85
51.4430 179.6050 30.00 NaN 7.3 NaN a
6 65 N N 9264
N

N
2 02/04/19 Na Na ISCGEM85
52.7730 171.9740 30.00 NaN 6.5 NaN a
7 65 N N 9324
N

N
2 02/04/19 Na Na ISCGEM85
51.7720 174.6960 20.00 NaN 5.6 NaN a
8 65 N N 9333
N
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

N
2 02/04/19 Na Na ISCGEM85
52.9750 171.0910 25.00 NaN 6.4 NaN a
9 65 N N 9358
N

..
... ... ... ... ... ... ... ... ... ... ...
.

2
3 0.
12/11/20 2.2 US2000800
3 -10.9640 161.5723 10.00 1.8 5.5 NaN 8.3 90
16 03 2
8 00
2

2
3 1.
12/14/20 6.1 US200080
3 21.2897 144.4037 22.37 1.8 6.0 NaN 7.3 01
16 24 M3
8 00
3

2
3 0.
12/14/20 5.9 US200080
3 21.3697 144.2175 10.00 1.7 5.5 NaN 8.2 74
16 94 TD
8 00
4
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 1.
12/16/20 1.3 US2000819
3 14.0882 -90.8691 71.26 3.7 5.5 NaN 6.7 26
16 67 R
8 00
5

2
3 0.
12/17/20 1.3 US200081
3 -4.5049 153.5216 94.54 3.8 7.9 NaN 7.3 97
16 89 V8
8 00
6

2
3 0.
12/17/20 0.06 1.3 10. US200081
3 -4.4244 153.5419 83.36 5.1 5.6 71
16 6 93 2 VZ
8 00
7

2
3 0.
12/17/20 2.3 US200081
3 -5.6497 153.9975 26.50 3.6 6.3 NaN 8.3 81
16 31 W0
8 00
8
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 0.
12/18/20 1.4 US2000825
3 -10.2137 161.2177 37.39 3.4 5.9 NaN 7.6 71
16 69 R
8 00
9

2
3 27. 0.
12/18/20 0.11 11. US2000826
3 -34.9886 -107.8694 10.00 1.6 5.5 65 80
16 0 9 E
9 4 00
0

2
3 0.
12/18/20 3.0 US2000826
3 -6.3046 154.3530 10.00 1.6 5.9 NaN 7.0 87
16 26 M
9 00
1

2
3 1.
12/18/20 8.7 US2000828
3 8.3489 137.6672 12.43 2.9 6.2 NaN 8.0 02
16 79 L
9 00
2
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 0.
12/18/20 0.04 1.4 US2000829
3 -10.1904 161.2187 57.52 5.2 5.5 8.8 79
16 8 58 3
9 00
3

2
3 0.
12/18/20 2.8 US200082
3 -9.9640 -70.9714 622.54 3.1 6.4 NaN 9.1 65
16 04 AN
9 00
4

2
3 0.
12/20/20 1.4 US200082P
3 -10.1773 161.2236 16.65 2.8 6.4 NaN 8.1 89
16 56 P
9 00
5

2
3 0.
12/20/20 7.1 US200082S
3 37.1442 84.9583 10.00 1.7 5.6 NaN 7.6 83
16 82 5
9 00
6
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 0.
12/20/20 1.2 US200082
3 -10.1785 160.9149 10.00 1.6 6.0 NaN 5.7 88
16 04 TK
9 00
7

2
3 0.
12/20/20 0.04 1.0 US10007LI
3 -10.1549 160.7816 10.38 3.2 5.5 7.0 70
16 8 87 X
9 00
8

2
3 1.
12/21/20 3.3 US10007L
3 -7.5082 127.9206 152.00 1.8 6.7 NaN 5.3 20
16 80 KW
9 00
9

2
3 0.
12/21/20 6.2 US10007L
4 21.5036 145.4172 12.05 2.9 5.9 NaN 7.6 76
16 39 QE
0 00
0
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 0.
12/24/20 1.7 US10007M
4 -5.2453 153.5754 35.00 1.9 6.0 NaN 6.9 91
16 53 F5
0 00
1

2
3 0.
12/24/20 1.6 US10007M
4 -5.1460 153.5166 30.00 1.8 5.8 NaN 7.0 85
16 48 FP
0 00
2

2
3 0.
12/25/20 0.3 US10007M
4 -43.4029 -73.9395 38.00 1.9 7.6 NaN 6.8 80
16 51 N3
0 00
3

2
3 0.
12/25/20 0.06 0.6 US10007M
4 -43.4810 -74.4771 14.93 3.3 5.6 7.1 52
16 7 97 NB
0 00
4
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 0.
12/27/20 0.4 US10007N
4 45.7192 26.5230 97.00 1.8 5.6 NaN 5.1 78
16 65 3R
0 00
5

2
3 0.
12/28/20 0.35 0.1 Na NN005707
4 38.3754 -118.8977 10.80 1.3 5.6 19
16 0 32 N 09
0 88
6

2
3 0.
12/28/20 0.32 0.1 Na NN005707
4 38.3917 -118.8941 12.30 1.2 5.6 18
16 0 20 N 10
0 98
7

2
3 0.
12/28/20 0.26 0.1 Na NN005707
4 38.3777 -118.8957 8.80 2.0 5.5 21
16 0 29 N 44
0 87
8
R
oo
Ho
Ho t
Mag riz
Dep riz M
nitu ont
th Magnitu ont ea
Date Latitude Longitude Depth de al ID
Err de al n
Err Dis
or Er S
or tan
ror q
ce
ua
re

2
3 1.
12/28/20 0.9 US10007N
4 36.9179 140.4262 10.00 1.8 5.9 NaN 4.8 52
16 92 AF
0 00
9

2
3 1.
12/29/20 3.5 US10007N
4 -9.0283 118.6639 79.00 1.8 6.3 NaN 6.0 43
16 53 L0
1 00
0

2
3 0.
12/30/20 0.02 0.6 US10007N
4 37.3973 141.4103 11.94 2.2 5.5 4.5 91
16 9 81 TD
1 00
1

(23412 rows × 11 columns)

year = range(1965,2017)
nulls = []
for i in year:
nulls.append(0)
dictionary = dict(zip(year,nulls))
dictionary

{1965: 0,
1966: 0,
1967: 0,
1968: 0,
1969: 0,
1970: 0,
1971: 0,
1972: 0,
1973: 0,
1974: 0,
1975: 0,
1976: 0,
1977: 0,
1978: 0,
1979: 0,
1980: 0,
1981: 0,
1982: 0,
1983: 0,
1984: 0,
1985: 0,
1986: 0,
1987: 0,
1988: 0,
1989: 0,
1990: 0,
1991: 0,
1992: 0,
1993: 0,
1994: 0,
1995: 0,
1996: 0,
1997: 0,
1998: 0,
1999: 0,
2000: 0,
2001: 0,
2002: 0,
2003: 0,
2004: 0,
2005: 0,
2006: 0,
2007: 0,
2008: 0,
2009: 0,
2010: 0,
2011: 0,
2012: 0,
2013: 0,
2014: 0,
2015: 0,
2016: 0}

year = range(1965,2017)
nulls = []
for i in year:
nulls.append(0)
dictionary = dict(zip(year,nulls))
years = new_f['Date']
i=0
while i <= 23411:
k=years[i][6:10]
for l in dictionary.keys():
if k==str(l):
dictionary[l]= 1+dictionary[l]
i=i+1
print(dictionary)

{1965: 339, 1966: 234, 1967: 255, 1968: 305, 1969: 323, 1970: 345, 1971: 386, 1972: 388,
1973: 401, 1974: 361, 1975: 411, 1976: 457, 1977: 425, 1978: 410, 1979: 356, 1980: 348,
1981: 321, 1982: 346, 1983: 453, 1984: 482, 1985: 475, 1986: 485, 1987: 505, 1988: 489,
1989: 480, 1990: 528, 1991: 429, 1992: 533, 1993: 466, 1994: 508, 1995: 591, 1996: 541,
1997: 456, 1998: 388, 1999: 446, 2000: 553, 2001: 443, 2002: 444, 2003: 485, 2004: 571,
2005: 533, 2006: 508, 2007: 608, 2008: 508, 2009: 517, 2010: 560, 2011: 712, 2012: 445,
2013: 461, 2014: 480, 2015: 446, 2016: 469}

frequency=
[339,234,255,305,323,345,386,388,401,361,411,457,425,410,356,348,321,346,453,482,475,4
85,505,489,480,528,429,533,466,508,591,541,456,388,446,553,443,444,485,571,533,508,60
8,508,517,560,712,445,461,480,446,469]
x = np.arange(52)
plt.figure(figsize=(20,10))
plt.bar(x+0.35, frequency, width = 0.35, label = "No_of_earthquake")
plt.xticks(x,['1965','1966','1967','1968','1969','1970','1971','1971','1972','1973','1974','1975','1
976','1977','1978','1979','1980','1981','1982','1983','1984','1985','1986','1987','1988','1989','199
0','1991','1992','1993','1994','1995','1996','1997','1998','1999','2000', '2001', '2002', '2003',
'2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015',
'2016'],rotation=90)
plt.show()
m1=new_f['Magnitude'].mean()
m2=new_f['Magnitude'].mode()
M1=new_f['Magnitude'].max()
sd=new_f['Magnitude'].std()
v=new_f['Magnitude'].var()

print (m1)
print (m2)
print (M1)
print (sd)
print (v)

5.88253075346
0 5.5
dtype: float64
9.1
0.423065639316
0.17898453517
year = range(1965,2017)
nulls = []
for i in year:
nulls.append(0)
dictionary = dict(zip(year,nulls))
years = new_f['Date']
i=0
while i <= 23411:
k=years[i][6:10]
for l in dictionary.keys():
if k==str(l):
dictionary[l]= 1+dictionary[l]
i=i+1

import pandas as pd
Data_summary=pd.DataFrame.from_dict(dictionary, orient='index')
Data_summary.columns=['Number_of_Earthquake']
Data_summary

Number_of_Earthquake

1965 339

1966 234

1967 255

1968 305

1969 323

1970 345

1971 386

1972 388

1973 401
Number_of_Earthquake

1974 361

1975 411

1976 457

1977 425

1978 410

1979 356

1980 348

1981 321

1982 346

1983 453

1984 482

1985 475

1986 485

1987 505

1988 489

1989 480

1990 528

1991 429

1992 533

1993 466

1994 508

1995 591

1996 541

1997 456

1998 388

1999 446
Number_of_Earthquake

2000 553

2001 443

2002 444

2003 485

2004 571

2005 533

2006 508

2007 608

2008 508

2009 517

2010 560

2011 712

2012 445

2013 461

2014 480

2015 446

2016 469

Data_summary.std()

Number_of_Earthquake 91.088348
dtype: float64

x=new_f['Depth']
y=new_f['Magnitude']
np.corrcoef(x, y)
array([[ 1. , 0.02345731],
[ 0.02345731, 1. ]])
plt.scatter(x, y)
plt.xlabel("Depth")
plt.ylabel("Magnitudes")
plt.title("Correlation between Depth and Magnitudes")
plt.show()

References
Biddix, D. J. (n.d.). Instrument, Validity, Reliability. Retrieved from Research Rundowns:
https://researchrundowns.com/quantitative-methods/instrument-validity-reliability/

Friedl, S. (n.d.). What is an Earthquake? - Definition and Components. Retrieved from Study.com:
https://study.com/academy/lesson/what-is-an-earthquake-definition-history.html

Futurist. (2016). Retrieved from Mapping of Earthquake And Its Analysis:


https://www.kaggle.com/futurist/mapping-of-earthquake-and-its-analysis/data

Is there a correlation between the earthquake's magnitude and its depth? (n.d.). Retrieved from
Open Hazards: http://www.openhazards.com/faq/earthquakes-faults-plate-tectonics-earth-
structure-user-submitted-questions/there-correlation
William Spence, S. A. (1989, November 01). Earthquake Hazards Program. Retrieved from USGS:
https://earthquake.usgs.gov/learn/topics/determining_depth.php

William Spence, S. A. (1989, November 01). USGS. Retrieved from Earthquake Hazards Program:
https://earthquake.usgs.gov/learn/topics/measure.php

You might also like