Live data from Hacker News

Why Jupyter is data scientists’ computational notebook of choice

nature.com

151–160 of 308 posts

Re: Why Jupyter is data scientists’ computational notebook of choice

#151

I recently wrote on how to build/grow clean software out of Jupyter notebooks and on pitfalls to avoid when coding like that: https://github.com/guillaume-chevalier/How-to-Grow-Neat-Soft...

I submitted it to HN too, why not! Here: https://news.ycombinator.com/item?id=18339703

Re: Why Jupyter is data scientists’ computational notebook of choice

#152

Earlier quoted context omitted.

Diffing JSON as text must be painful. Diffing JSON as data should be somewhat simple.

Are there any merge tools that offer features for this a lot more sophisticated than basic text comparison?

Not merge, but jq can diff, and it can also do a consistent dump (jq -cS) for you.

Edit: to clarify, jq -S does deep keys sorting.

  $ echo '{"z":{"b": "second", "a": "first"}, "x": 4, "y": 7}' | jq -S
  {
    "x": 4,
    "y": 7,
    "z": {
      "a": "first",
      "b": "second"
    }
  }

Re: Why Jupyter is data scientists’ computational notebook of choice

#153

Version control for Jupyter notebooks was one of the biggest complaint I had. Specifically, diff and merge with the JSON files (.ipynb) is ugly. I built ReviewNb[1] to solve one of those problems (diff). Note that, there is nbdime[2] which works well for local diff/merge. The idea for ReviewNb is to have much tighter integration with GitHub etc. [1] https://reviewnb.com [2] https://nbdime.readthedocs.io/en/latest/

RStudio’s Markdown notebooks do not suffer from this and save a separate output file that can be gitignored.

RMarkdown and Knitr are dramatic improvements in terms of final outputs and VC relative to notebooks. Notebook believers (Satan worshippers, imho) would suggest that notebooks are best for developing in and not primarily made for use as final outputs.

Re: Why Jupyter is data scientists’ computational notebook of choice

#154
IMO Jupyter notebooks are popular because it's open source, they are convenient and they help a lot illustrating an idea.

The results of a notebook can be shared more easily than a plain repository(via nbviwer or binder) and more importantly the science there it's reproducible.

Re: Why Jupyter is data scientists’ computational notebook of choice

#155
post #4

What was the earliest of these tools? Mathcad? Mathematica? Maple?

there’s a relatively esoteric paradigm known as “literate programming” which has been around since Knuth (he wrote the book [0]) and that has some software tools associated, of which Jupyter is a particularly web-age example. [0]: https://en.m.wikipedia.org/wiki/Literate_programming

Literate programming was esoteric, true, but the concept saw a huge renaissance in academia and data science with the advent of RMarkdown¹ which for many of my colleagues is the default way of preparing technical documents. Another area in which literate programming has become hugely popular is Emacs' Org-mode ecosystem which has fantastic support in the form of Org Babel². I use literate programming for almost everything. Research papers, tech reports, notes, experiments, teaching materials, letters, student evaluations, and so on. It's completely ridiculous how useful it is once you get the hang of it and make it your default document type.

[1] https://rmarkdown.rstudio.com/ [2] https://orgmode.org/worg/org-contrib/babel/

Re: Why Jupyter is data scientists’ computational notebook of choice

#156

Out of curiosity, what other options are there?

for python, org-mode in emacs will do it. but that ties you down to emacs.

Org-mode was a total game changer for my work life. I use it for almost everything. Yes, it ties me to Emacs. I don't see this as a problem.

Re: Why Jupyter is data scientists’ computational notebook of choice

#157

Version control for Jupyter notebooks was one of the biggest complaint I had. Specifically, diff and merge with the JSON files (.ipynb) is ugly. I built ReviewNb[1] to solve one of those problems (diff). Note that, there is nbdime[2] which works well for local diff/merge. The idea for ReviewNb is to have much tighter integration with GitHub etc. [1] https://reviewnb.com [2] https://nbdime.readthedocs.io/en/latest/

RStudio’s Markdown notebooks do not suffer from this and save a separate output file that can be gitignored.

And they pay for this on other accounts:

No inline rendering of markdown.

Opening an .Rmd file is a lottery to see if rendered graphs and tables still exists.

Tables render completely differently in editor, HTML and pdf

Re: Why Jupyter is data scientists’ computational notebook of choice

#158

Earlier quoted context omitted.

I have felt the same way in the past. There are some ways to do this, but none is great. Unfortunately using a text editor to put in the notebook text areas is not that straightforward because of security features in modern browsers. Since jupyter is actually a server (usually running locally) it's possible to communicate directly with it from a sufficiently advanced editor, but haven't seen any good execution of tha…

This is not what I mean. Mine is a problem of file formats, not of interactivity. I want to edit a text file alone, without need for any web browser in my computer. Then I push the notebook to git, and somewhere else it is opened by the browser. This would be possible today if the notebook file was python code with comments, for example, instead of an uneditable json.

This is quite a neat idea. A couple of people have mentioned Jupytext around here. I found a guide with animations which appears like it might do what you want. [0]

I personally look forward to trying this out, as it means that I can use Jupyter in a way that doesn't mean adapting my workflow to the tool so much.

[0] https://towardsdatascience.com/introducing-jupytext-9234fdff...

Re: Why Jupyter is data scientists’ computational notebook of choice

#159

Earlier quoted context omitted.

And then there is the Zelig modeling framework for R that I can’t imagine not using after having used it. Don’t get me wrong, I like Python well enough, and knew it before I coded R. But Python is really behind R in stats support. I’d also add the tidyverse in there for general data munging. If I want libraries I’ll use R; if I want a programming language I love I'll use Racket or maybe Clojure; if I want some librar…

Woa, thanks for pointing out Zelig, I needed that relogit and I didn't even know it :)

The counter factual simulation features are amazing and easy.

Re: Why Jupyter is data scientists’ computational notebook of choice

#160

Earlier quoted context omitted.

If you are interested in workbooks which are collaborative and versioned, take a look at http://datalore.io/ Version control is transparent and integrated and it's possible to work with workbooks collaboratively.

Any chance of this being offered for on-prem install in the future? Looks interesting but cloud only makes it a no go for my team.

We're building something just like that at qri (https://qri.io) a free and open source dataset version control system. Right now all datasets on qri are public by default, but we're working toward supporting. encryption and private networks.
Post reply on HN