Data Interview Qs - Damage due to natural disasters

InterviewQs

Damage due to natural disasters

Python Data Structures External Dataset Data Visualization Data Processing

Forward this email to a friend or colleague and challenge them to solve it.

Hi, 

Suppose you are given this dataset on storm events in 2019 from NOAA.

Using this data, you're asked to calculate the following:

  • Total monetary damage in 2019
  • Top 5 states in 2019 with highest monetary damage
  • Plot the total monetary damage by month

The code below will help trim down the dataset so you can focus on a few columns. Below are descriptions for the included fields:

  • EVENT_ID: Unique ID for the storm event
  • STATE: State where the event occured
  • EVENT_TYPE: Type of storm event
  • BEGIN_DATE_TIME: The end time of the event. Format is MM/DD/YYYY 24 hour time AM/PM
  • BEGIN_YEARMONTH: The year and month of the event
  • DAMAGE_PROPERTY: The estimated amount of damage to property incurred by the weather event. For example, 10.00K = 10,000; 10.00M = 10,000,000. You will need to convert this field in order to successfully do the calculations listed above.
  • DAMAGE_CROPS: The estimated amount of damage to crops incurred by the weather event. For example, 10.00K = 10,000; 10.00M = 10,000,000. You will need to convert this field in order to successfully do the calculations listed above.

You can find more information regarding the dataset fields here and you can view other years of data here.

To help get you started, below is Python code that imports the data and only includes the fields needed to do the analysis. You can also view the code in this Google Colab notebook.

    

# Importing packages

import pandas as pd

import matplotlib.pyplot as plt

import numpy as np

# Reading in data

df = pd.read_csv('https://www1.ncdc.noaa.gov/pub/data/swdi/stormevents/csvfiles/StormEvents_details-ftp_v1.0_d2019_c20200219.csv.gz', parse_dates=True)

df = df[['EVENT_ID',

'STATE',

'EVENT_TYPE',

'CZ_TYPE',

'BEGIN_DATE_TIME',

'BEGIN_YEARMONTH',

'DAMAGE_PROPERTY',

'DAMAGE_CROPS'

]]

df.head()

EVENT_ID STATE EVENT_TYPE CZ_TYPE BEGIN_DATE_TIME BEGIN_YEARMONTH ...
0 824116 TEXAS Flash Flood C 09-MAY-19 15:54:00 201905 ...
1 843354 MINNESOTA Thunderstorm Wind C 15-JUL-19 16:40:00 201907 ...
2 861581 TEXAS Thunderstorm Wind C 20-OCT-19 22:23:00 201910 ...
3 861584 TEXAS Thunderstorm Wind C 20-OCT-19 23:12:00 201910 ...
4 861582 TEXAS Thunderstorm Wind C 20-OCT-19 22:36:00 201910 ...

Solution will be written in Python for premium users.



 

You’ve accumulated 284 questions since joining our email list. Create a premium account to access detailed solutions to each problem (including this one) + our new Case studies.


Was this email forwarded to you? You can join our list here to receive questions

How did you like today's question?

15411 Boischatel, Montreal, QC, H9H1Y7, Canada
Don't want to get these emails anymore? We'll forgive you if you unsubscribe

Key phrases

Older messages

Maximizing value of your knapsack

Friday, April 22, 2022

Python, Arrays, Data Structures, Algorithms, InterviewQs Maximizing value of your knapsack Python Arrays Data Structures Algorithms Forward this email to a friend or colleague and challenge them to

Normalizing cholesterol data

Wednesday, April 20, 2022

Python, Normalizing Data, ML Concept, Data Processing, InterviewQs Normalizing cholesterol data Python Normalizing Data ML Concept Data Processing Forward this email to a friend or colleague and

Allocating votes from pooled elections

Monday, April 18, 2022

SQL, Database Querying, Subquery, InterviewQs Allocating votes from pooled elections SQL Database Querying Subquery Forward this email to a friend or colleague and challenge them to solve it. Hi,

Estimating the confidence interval for the length of an angelfish

Monday, April 11, 2022

Statistics, Confidence Intervals, InterviewQs Estimating the confidence interval for the length of an angelfish Statistics Confidence Intervals Forward this email to a friend or colleague and challenge

Classifying animals in SQL

Friday, April 8, 2022

SQL, Database Querying, Window Function, Subquery, InterviewQs Classifying animals in SQL SQL Database Querying Window Function Subquery Forward this email to a friend or colleague and challenge them

You Might Also Like

The best work laptop for most people

Friday, April 26, 2024

Old Kindle? Don't do this; How to change your IP address; Net neutrality restored -- ZDNET ZDNET Tech Today - US April 26, 2024 placeholder The work laptop I recommend to most people is not made by

New 'Brokewell' Android Banking Malware Spread Through Fake Browser Updates

Friday, April 26, 2024

THN Daily Updates Newsletter cover Webinar -- Uncovering Contemporary DDoS Attack Tactics -- and How to Fight Back Stop DDoS Attacks Before They Stop Your Business... and Make You Headline News.

Apple announces an iPad event for May 7

Friday, April 26, 2024

The Morning After It's Friday, April 26, 2024. Apple has scheduled its next product showcase for May 7, a few weeks before its Worldwide Developers Conference, clearing space for even more

[AI Incubator] Enrollment ends tonight.

Friday, April 26, 2024

Text or WhatsApp me your questions ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Post from Syncfusion Blogs on 04/26/2024

Friday, April 26, 2024

New blogs from Syncfusion Create Excel Table in Just 3 Steps Using C# By Mohan Chandran This blog explains how to create a table in an Excel document using Syncfusion .NET Excel Library in C# with code

ASP.NET Core News - 04/26/2024

Friday, April 26, 2024

View this email in your browser Get ready for this weeks best blog posts about ASP.NET Core! This newsletter is sponsored by elmah.io - the most advanced, yet so simple to set up, error logging and

Hacker Newsletter #697

Friday, April 26, 2024

Don't watch the clock; do what it does. Keep going. //Sam Levenson hackernewsletter Issue #697 // 2024-04-26 // View in your browser #Favorites Lattice is the AI-powered people platform that

TikTok threatens shutdown 📱, FCC passes net neutrality 🌐, the robotics renaissance 🤖

Friday, April 26, 2024

ByteDance would rather shut down TikTok than sell the company Sign Up |Advertise|View Online TLDR Together With Plaid TLDR 2024-04-26 6 fintech predictions you need to know for 2024 (Sponsor)

📧 What's inside MMA and how it can help you

Friday, April 26, 2024

What's Inside Modular Monolith Architecture? Hey there! 👋 I wish you an excellent end to the week. What better way to spend the weekend than diving headfirst into a 12+ hour course? Well, maybe

Data Science Weekly - Issue 544

Friday, April 26, 2024

Curated news, articles and jobs related to Data Science, AI, & Machine Learning ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏