Notebook Documents

    %reload_ext pidgin
    import graphviz
%reload_ext pidgin
import graphviz
# Notebooks & computational documents


### Computational documents
## multi hypermedia collage

## An example: Business reports

* Word, Excel, Powerpoint, `...`


> ### Name some other computational documents.

Notebooks & computational documents

Computational documents

multi hypermedia collage

An example: Business reports

  • Word, Excel, Powerpoint, ...

Name some other computational documents.

## Some other computational documents

* HTML
* Markdown
* PDF
* Latex
* Jupyter notebooks
* Software packages

Some other computational documents

  • HTML
  • Markdown
  • PDF
  • Latex
  • Jupyter notebooks
  • Software packages
## Words & not words

Data-driven documents go beyond words to include data, code, & visuals fill voids in language.

### Computational Documents are multi-lingual

Words & not words

Data-driven documents go beyond words to include data, code, & visuals fill voids in language.

Computational Documents are multi-lingual

## Literate programs

Our savior [Donald Knuth](https://en.wikipedia.org/wiki/Donald_Knuth).

* [The Patron Saint of Yak Shaves](https://yakshav.es/the-patron-saint-of-yakshaves/)

Literate programs

Our savior Donald Knuth.

## Precedence in journalism

Data driven journalism is athe forefront of comminicating information.|

* [`"django"`](https://en.wikipedia.org/wiki/Django_(web_framework))
    
    ![](https://user-images.githubusercontent.com/4236275/65614341-fc2ec700-dfa6-11e9-9b00-741b974d3142.png)
    
* [The future of news is not an article](http://nytlabs.com/blog/2015/10/20/particles/)
* [LA times uses altair](https://github.com/datadesk/altair-latimes/pull/1)

Precedence in journalism

Data driven journalism is athe forefront of comminicating information.|

* ## Code > Narrative
* ## Narrative > Code

> ### Which is role the of `"data scientist"`, and `"software engineer"`?
  • Code > Narrative

  • Narrative > Code

Which is role the of "data scientist", and "software engineer"?

my_function_that_changes_the_world_cause_I_said_so then I’ll key programming

Code > Narrative

Informal names are adopted for literacy and narrative in "docstrings" are secondary to the code.

    def my_function_that_changes_the_world_cause_I_said_so(): 
        """>>> assert 42, 'This function does not change the world'"""
def my_function_that_changes_the_world_cause_I_said_so(): 
    """>>> assert 42, 'This function does not change the world'"""

Narrative Over Code

my function that changes_the_world cause I said so` then I’ll key programming

def function(): """>>> assert 42"""
def changes_the_world(): """>>> assert True"""

Literate documents include code & multimedia in formal language to connect features of the human and machine language.

### Doctesting and docstrings

    import doctest

Tests provide trust to an `object`.  Place `doctest`s in your function to run tests interactively.

    doctest.testmod()
TestResults(failed=0, attempted=3)

Notebooks simulate a document.

They are a flexible form to project different forms of multi hypermedia documents.

    graphviz.Source("digraph {Notebooks->{ %s }}"%' '.join(x for x in __import__('nbconvert').get_export_names() if not '_' in x))

svg

graphviz.Source("digraph {Notebooks->{ %s }}"%' '.join(x for x in __import__('nbconvert').get_export_names() if not '_' in x))

Written on September 25, 2019