Answered step by step
Verified Expert Solution
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
dfRawXXXXdate pdtodatetimedfRawdate formatYmd
dfRawXXXXmonth dfRawdatedtmonth
dfRawXXXXyear dfRawdatedtyear
b Earthquake category
tempList
for i in dfRawXXXXmagnitudetolist:
tempVar
if i:
tempVar 'Micro'
elif i:
tempVar 'Minor'
elif i:
tempVar 'Light'
elif i:
tempVar 'Moderate'
elif i:
tempVar 'Strong'
elif i:
tempVar 'Major'
else:
tempVar 'Great'
tempList.appendtempVar
dfRawXXXXearthquakeCategory tempList
c Depth category
tempList
for i in dfRawdepthtolist:
tempVar
if i:
tempVar 'Shallow'
elif i:
tempVar 'Intermediate'
else:
tempVar 'Deep'
tempList.appendtempVar
dfRawdepthCategory 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started