Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog...

45
1 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Jupyter Notebooks in Dyalog APL Adám Brudzewsky

Transcript of Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog...

Page 1: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

1

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Jupyter Notebooks in Dyalog APLAdám Brudzewsky

Page 2: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

2

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

What are notebooks?A notebook combines the functionality of

a word processor — handles formatted texta "shell" or "kernel" — executes statements in a programming language and includes output inlinea rendering engine — rendersHTML in addition to plain text

Page 3: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

3

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

1½ Example notebookusing Python

global density of metal bands

Page 4: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

4

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

1½ Example notebookusing Python

global density of metal bands

Page 5: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

5

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

1½ Example notebookusing Dyalog APL

health care expenditure vs GDP per capita

Page 6: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

6

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

1½ Example notebookusing Dyalog APL

health care expenditure vs GDP per capita

Page 7: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

7

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Notebook benefitsA single document that combines explanations with executable code and its output — an ideal way to provide:

reproducible research resultsdocumentation of processesinstructionstutorials and training materials of all shapes and sizes

A digital learning environmentfor computational thinking

Page 8: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

8

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

What is Jupyter notebook?First notebook: Mathematica 1.0 in '88Jupyter notebook is a part ofProject Jupyter, a nonprofit to

develop open-source software,standards, and services forinteractive computing across dozens of programming languages

beginning with Julia, Python, R, and now over 70 languages, including Dyalog APL

Page 9: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

9

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

What is Jupyter notebook?First notebook: Mathematica 1.0 in '88Jupyter notebook is a part ofProject Jupyter, a nonprofit to

develop open-source software,standards, and services forinteractive computing across dozens of programming languages

beginning with Julia, Python, R, and now over 70 languages, including Dyalog APL

ONE OF THE MOST SIGNIFICANT ADVANCES

IN THE SCIENTIFIC COMPUTING ARENA

UNIVERSITY CORPORATION FOR ATMOSPHERIC

RESEARCH

Page 10: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

10

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ways to use Jupyter notebooksOn your own computer after installing a Jupyter notebook serverWith an online notebook server like cocalc.comSave notebook with output and use a notebook viewerExport to HTML, PDF, LATEX, etc.

Page 11: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

11

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Local notebook server — Python

Page 12: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

12

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Python

Page 13: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

13

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Python

notebook serverlocalhost:8888

Page 14: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

14

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

Page 15: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

15

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Pythoninterpreter

Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

Page 16: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

16

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Pythoninterpreter

Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

web browser

Page 17: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

17

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Pythoninterpreter

Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

web browser

Page 18: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

18

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Pythoninterpreter

Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

web browser

Page 19: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

19

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Pythoninterpreter

Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

web browser

Page 20: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

20

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — Pythoninterpreter

Python

notebook serverlocalhost:8888

Jupyter kernelfor Python

web browser

Page 21: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

21

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — APL

notebook serverlocalhost:8888

Page 22: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

22

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — APL

notebook serverlocalhost:8888

Jupyter kernelfor Dyalog APL

Page 23: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

23

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — APL

notebook serverlocalhost:8888

interpreterDyalog APL

Jupyter kernelfor Dyalog APL

Page 24: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

24

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — APL

notebook serverlocalhost:8888web browser

interpreterDyalog APL

Jupyter kernelfor Dyalog APL

Page 25: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

25

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — APL

notebook serverlocalhost:8888web browser

interpreterDyalog APL

Jupyter kernelfor Dyalog APL

Page 26: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

26

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

AnacondaPython platform

Local notebook server — APL

notebook serverlocalhost:8888web browser

interpreterDyalog APL

Jupyter kernelfor Dyalog APL

Page 27: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

27

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Setting up local notebook serverInstall Dyalog Install Dyalog's Jupyter kernelInstall AnacondaLaunch Jupyter notebook server

Page 28: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

28

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Setting up local notebook serverInstall Dyalog Install Dyalog's Jupyter kernelInstall AnacondaLaunch Jupyter notebook server

installation instructions

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Page 29: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

29

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Installing JupyterOpening a notebookModifying content

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Page 30: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

30

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Online notebook serversThere are online services for various programming languages

Page 31: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

31

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Online notebook serversTryAPL's lessons are now Jupyter notebooks

Page 32: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

32

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Online notebook serversTryAPL's lessons are now Jupyter notebooksMore lessons and

features on the way

Page 33: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

33

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Online notebook serversTryAPL's lessons are now Jupyter notebooksMore lessons and

features on the way

→ TryAPL presentation at Dyalog '18 in Belfast

Page 34: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

34

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Online notebook serversBenefit: nothing to install

you may need to sign up for an accountTo protect servers, host may place restrictions

or run in a sandbox with limited connectivityNotebooks can execute any code

all code is run on the host serversame privileges as local execution

Page 35: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

35

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Static notebook viewersNotebooks are stored as .ipynb files

.ipynb files are in JSON formateach code cell may include output from the last execution

You can share an .ipynb fileanyone with a local notebook server can view it… but of course cannot execute anything new

Many online systems have viewersGitHub's file previewerProject Jupyter's nbviewer.jupyter.org

Page 36: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

36

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Exported notebooksNotebooks can be exported to many standard

for example HTML, PDF, and LATEXSome formats require 3rd party plug-insExported notebooks are static

expressions cannot be re-executed

Page 37: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

37

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Creating a new notebook documentGenerating rich output

Page 38: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

38

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ways to use notebooks — recapInstalling a Jupyter notebook server on your PCUse an online notebook server like cocalc.comStore the notebook with output, then open in a notebook viewerExport to HTML, PDF, LATEX, …

Page 39: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

39

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ask questions now!Wiki github.com/Dyalog/dyalog-jupyter-kernel/wikiEmail [email protected]

Page 40: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

40

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ask questions now!Wiki github.com/Dyalog/dyalog-jupyter-kernel/wikiEmail [email protected]

Thank youTechnology Partnership (tp.rs)

for the prototype APL kernel

Page 41: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

41

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ask questions now!Wiki github.com/Dyalog/dyalog-jupyter-kernel/wikiEmail [email protected]

Thank youWill Robertson (our summer intern)

for working on the kerneland creating many notebooks

Page 42: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

42

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ask questions now!Wiki github.com/Dyalog/dyalog-jupyter-kernel/wikiEmail [email protected]

Thank youWill Robertson (our summer intern)

for working on the kerneland creating many notebooks

Interested in an internship?Email [email protected]

Page 43: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

43

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ask questions now!Wiki github.com/Dyalog/dyalog-jupyter-kernel/wikiEmail [email protected]

Thank youGil Athoraya (of Optima Systems)

for implementing syntax colouring

Page 44: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

44

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Ask questions now!Wiki github.com/Dyalog/dyalog-jupyter-kernel/wikiEmail [email protected]

Thank youfor watching

Page 45: Jupyter Notebooks in Dyalog APL35 dyalog.tv @dyalogapl #dyalog github.com/Dyalog/dyalog-jupyter-kernel/wiki Static notebook viewers Notebooks are stored as .ipynb files.ipynb files

45

dyalog.tv @dyalogapl #dyalog

github.com/Dyalog/dyalog-jupyter-kernel/wiki

Webinars on Thursdays at 16:00 UTCComment and suggest to [email protected] or@Adám in chat.stackexchange.com/rooms/52405

No webinar in October due to Dyalog '18 in Belfast October 28th–November 1st

many sessions will be livestreamed

General APL Questionsstackoverflow.com