-
Notifications
You must be signed in to change notification settings - Fork 0
Working with notebooks
Gerben J. de Boer edited this page Dec 13, 2018
·
8 revisions
Notebooks are webbased documents that allow you to write and run computer code (e.g. python) and incorporate rich text elements (e.g. paragraph, equations, figures, links). For this reason it is a quick and easy, and hence widely preferred, method to develop simple code.
Once your code is more mature, it may be worthwhile to transfer generic elements of your code to a package.
You can make interactive plot.y plots inside your notebook with this exanmple code. (Previously you needed to register with plot.ly, that is no longer the case.)
import plotly
plotly.offline.init_notebook_mode() # run at the start of every notebook
import numpy as np
x = np.arange(10)
y = np.sin(x)
z = np.cos(x)
plotly.offline.iplot({
"data": [{"x": x,"y": y,"name":'Hs'},
{"x": x,"y": z,"name":'Tz'}]})
plotly.plotly.get_config()
plotly.__version__