#!/usr/bin/env python3
# Question1
 pb3 = open("file.pb3.csv")
 for lind in pb3.readlines():
     WaterLevel = line.split(",")[1]
     print(WaterLevel)
 WaterLavel_list = []
 WaterLavel_list.append(WaterLevel)
 max(WaterLavel_list)

# Question2
pb3 = pandas.read_csv('file.pb3.csv')
pb3.max()

# Question3
pb3_water = pb3.iloc[:,1]
pb3_diff = pb3_water.diff()
pb3_diff.max()


# Question4
pb3['Date Time'].str.split(' ', 1, expand = True)  #I use this code to separate ‘Date’ and ‘Time’
pb3_new = pd.concat([pb3['Date Time'].str.split(' ', 1, expand = True),pb3[[' Water Level']]], axis = 1, ignore_index = True)
x = pb3_new[[1]]
y = pb3_new[[2]]
import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot(x[1],y[2])
fig.savefig('my_figure.png')
