Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The data.csv contains more than eighty thousand earthquake events in Indonesia. The features or columns in the original file of data.csv are date, time, latitude,

The data.csv contains more than eighty thousand earthquake events in Indonesia. The features
or columns in the original file of data.csv are date, time, latitude, longitude, depth, and
magnitude. Save the data.csv into a data frame variable of dfRawXXXX. Before doing the data
analysis and data visualisation to give insight into the dataset, add date, month, year, earthquake
category and depth category features to the dataset by using the following code:
a) Date, month and year features
dfRawXXXX['date']= pd.to_datetime(dfRaw['date'], format='%Y-%m-%d')
dfRawXXXX['month']= dfRaw['date'].dt.month
dfRawXXXX['year']= dfRaw['date'].dt.year
b) Earthquake category
tempList =[]
for i in dfRawXXXX['magnitude'].tolist():
tempVar =''
if (i<3):
tempVar = 'Micro'
elif (i<4):
tempVar = 'Minor'
elif (i<5):
tempVar = 'Light'
elif (i<6):
tempVar = 'Moderate'
elif (i<7):
tempVar = 'Strong'
elif (i<8):
tempVar = 'Major'
else:
tempVar = 'Great'
tempList.append(tempVar)
dfRawXXXX['earthquakeCategory']= tempList
c) Depth category
tempList =[]
for i in dfRaw['depth'].tolist():
tempVar =''
if (i<71):
tempVar = 'Shallow'
elif (i<301):
tempVar = 'Intermediate'
else:
tempVar = 'Deep'
tempList.append(tempVar)
dfRaw['depthCategory']= tempList
Visualise the data using as many data visualisation techniques as possible in Python by
importing the seaborn module and the matplotlib.pyplot module to get the insight.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

5 What are the ongoing challenges for HRM?

Answered: 1 week ago

Question

4 What typifies the first and second waves of HRM?

Answered: 1 week ago