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.
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]:
In [4]:
# plots the entire data set
tides.plot(title="Sea level height (m)")
Out[4]:
In [5]:
# plots just one month in the data set
tides['June 2014'].plot(title="Sea level height (m)")
Out[5]:
In [6]:
# or just one day
tides['June 1 2014'].plot(title="Sea level height (m)")
Out[6]:
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]:
In [ ]: