Question 1

What are is the maximum and minimum amount of precipitation in 2014?

The maximum amount of rain was 467 mm and the smallest amount of precipitation was 3 mm

Question 2

How many days had less than 10 inches of precipitation in 2014?

There were 357 days with less than 10 inches of rain.

Question 3

How many days had more than 5 inches of precipitation in 2014?

There were 37 days with less than 10 inches of rain.

Question 4

How many days had more than 5 inches of rain but less than 20 of precipitation in 2014?

There were 37 days that received more than 5 inches of rain but less than 20 inches of rain.

Qustion 5

How many days received no rain?

There were 215 days without rain in Seattle.

Qustion 6

How many days did it rain in Seattle?

There were 150 rainy days in Seattle.

Question 7

What was the median precipitation on rainy days?

The median precipitation on rainy days was 49.5 mm or 1.95 inches.

Question 8

What was the median precipitation on summer days?

The median precipitation during the summer was 0 mm or 0 inches.

Question 9

What was the maximum precipitation on summer days?

The maximum amount of precipitation during the summer was 216 mm or 8.5 inches.

Question 10

What was the median precipitation on non-summer days?

The median precipitation on non-summer days was 0 mm

Question 11

What was the median precipitation on non-summer rainy days?

The median precipitation on non-summer rainy days was 51 mm or 2.01 inches.

Python Code

import pandas as pan
import numpy as np



Seattle = pan.read_excel("C:/Users/Rustg/Downloads/Seattle2014.xlsx")


## Question 1
Rain_Data = np.array(Seattle['PRCP'].copy())
Max_and_Min =( Rain_Data.min(),Rain_Data.max())


## Question 2
Rain_data_inches = Rain_Data.copy()/25.4


Ten_inches_or_less =np.count_nonzero(Rain_data_inches<10)

## Question 3
Five_inches_or_more =(Rain_data_inches>5).sum()



## Question 4
five_and_20 = np.sum((Rain_data_inches>5)&(Rain_data_inches<20))

## Question 5
no_rain = np.sum(Rain_Data==0)

## Question 6
Rainy_days = np.count_nonzero(Rain_Data>0)


## Question 7
middle_ground = np.median(Rain_Data[Rain_Data>0])


## Question 8
Summer_days = Rain_Data[172:262].copy()
Middle_Summer_rain = np.median(Summer_days)

## Question 9
Max_Summer_days = Summer_days.max()


## Question 10
Nonsummer_days =np.concatenate((Rain_Data[:171],Rain_Data[-103:365])) 

Non_summer_median = np.median(Nonsummer_days)

## Question 11
Non_summer_median_rainy = np.median(Nonsummer_days[Nonsummer_days>0])