Analyzing Tides

This sea level data spans 2011-2015 for Mornington Island, Australia.

Thanks to UCF undergraduates Lissa Galguera, for finding the, and Hunter Tanchin, for starting the development of this notebook.


In [1]:
# The first pieces of code we need to start with are called 'imports'

import numpy as np
import pandas as pd
%matplotlib inline
import matplotlib.pyplot as plt

# These imports contain programming instructions (called 'modules') to read data, plot data, etc.
# You can think of imports like tool boxes. Each tool box contains a different set of tools (modules) to use.

Importing the Data


In [2]:
# We need to read some data. Let's use our tool ".read_csv" located in the "pd" import.
data = pd.read_csv("https://github.com/adamlamee/CODINGinK12-data/raw/master/tides.csv", names = ["rawData"])

data['height'] = data.rawData.str[13:].astype(float)
data['rawTime'] = data.rawData.str[:12]
dates = pd.to_datetime(data.rawTime.tolist(), format='%d%m%Y%H%M')
tides = pd.Series(data.iloc[:,1].tolist(), dates)

In [3]:
# displays the first several entries of the data set
tides.head(5)


Out[3]:
2011-01-01 00:00:00    2.560
2011-01-01 00:10:00    2.539
2011-01-01 00:20:00    2.494
2011-01-01 00:30:00    2.460
2011-01-01 00:40:00    2.411
dtype: float64

Plotting the data


In [4]:
# plots the entire data set
tides.plot(title="Sea level height (m)")


Out[4]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fb21e255ba8>

In [5]:
# plots just one month in the data set
tides['June 2014'].plot(title="Sea level height (m)")


Out[5]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fb216ff5518>

In [6]:
# or just one day
tides['June 1 2014'].plot(title="Sea level height (m)")


Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fb21ba2f240>

In [7]:
# plots a range of times in the data set
tides['Jan 22 2012':'July 28 2012'].plot(title="Sea level height (m)")


Out[7]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fb21ba21f28>

Ideas for analyses

  • How can you identify a high tide on the graph? How many high tides happened in September 2015?
  • What patterns do you see in the data?
  • Are there daily, monthly, or yearly patterns? Why do you think so?
  • How can neap tides be identified in a graph?
  • What do you think happened in June 2011?
  • This data comes from Australia. How might it be different from data taken in Florida?

In [ ]: