In [12]:
# this is a notebook
In [13]:
# we can write code
print("hello world")
In [62]:
import numpy as np
import matplotlib.pyplot as plt
In [63]:
x = np.linspace(0,3, num=100)
In [64]:
y = x + np.random.normal(loc=0, scale=1, size=100)
In [65]:
plt.plot(x, y, 'k.')
Out[65]:
In [68]:
np.linspace
Out[68]:
In [69]:
np.linspace?
In [70]:
np.linspace??
In [73]:
#np.linspa#tab
In [72]:
#np.linspace(#shift tab)
In [76]:
import pandas
import requests
import io
In [83]:
response = requests.get('http://publicwiki.deltares.nl/download/attachments/90415361/RondeHoep.csv')
response.text[:20]
Out[83]:
In [84]:
df = pandas.read_csv(io.StringIO(response.text))
In [87]:
df.head()
Out[87]:
In [104]:
_ = df.groupby('Period').plot('EC', 'IR', style='.')
# http://publicwiki.deltares.nl/display/VWD/Home
In [107]:
!ls
In [111]:
files = !ls
In [112]:
[f for f in files if not f.endswith('.ipynb')]
Out[112]:
In [114]:
!less cropped.jpg
In [125]:
import IPython.display
In [135]:
IPython.display.Image('cropped.jpg', width=300)
Out[135]:
In [130]:
img = plt.imread('cropped.jpg')
plt.imshow(img)
Out[130]:
In [124]:
import skimage.filter
In [134]:
# detect areas that are lighter than their surroundings
plt.imshow(skimage.filter.gaussian_filter(img, 6) - skimage.filter.gaussian_filter(img, 5))
Out[134]:
In [141]:
from IPython.html.widgets import interact
def plot(sigma):
plt.imshow(skimage.filter.gaussian_filter(img, sigma) - skimage.filter.gaussian_filter(img, sigma-1))
interact(plot, sigma=(3,7))
In [ ]: