Live data from Hacker News

Jupyter Notebook 7

blog.jupyter.org

111–118 of 118 posts

Re: Jupyter Notebook 7

#111
post #21

Earlier quoted context omitted.

Curious what other approach you would take to do exploratory data analysis? It's so natural to me I can't think of another way that would be practical to achieve the same workflow.

emacs org mode can do this but is not tied to just python. Anyway, something like this works: #+BEGIN_SRC python :results file import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt fn = 'my_fig.png' plt.plot([1, 2, 3, 2.5, 2.8]) plt.savefig('my_fig.png', dpi=50) return fn #+END_SRC #+RESULTS: [[file:my_fig.png]]

In a true notebook you would maybe want to do the following:

  import matplotlib
  matplotlib.use('Agg')
  import matplotlib.pyplot as plt
  plt.plot([1, 2, 3, 2.5, 2.8])

  Alright, saving the figure at 50 dpi first
  plt.savefig('my_fig.png', dpi=50)

  Trying a bit more DPI to see if that makes a difference
  plt.savefig('my_fig2.png', dpi=150)

  Oh, wrong numbers, forgot that the fourth datapoint was going to signify 100, going back to 50 dpi as well
  plt.plot([1, 2, 3, 100, 2.3])
  plt.savefig('my_fig4.png', dpi=50)
It seems like your example misses the interactivity.

Re: Jupyter Notebook 7

#112

Earlier quoted context omitted.

Good for developing ideas that you can add small code fragments gradually and see results immediately. And if it gets big enough, chances are that you have a good idea that makes it worth the time to refactor your notebook into production code.

I refactor my code into functions as I go. Then I can easily put them into a Python file and import them from the notebook. Easy peasy and very nice for iterative development.

Just started down this path, its such a nice workflow. I find that my notebook ends up with being a great overview of my codebase without going into the details of every function.

Re: Jupyter Notebook 7

#113
post #102

Does debugging work for you? Neither in Notebook nor in Lab can I click in the gutter to set breakpoints. The debugging panel is open, the documentation is clear (except that by default there are no line numbers and you have to activate that), but nothing happens. Where exactly am I supposed to click?

There is a little bug icon in the toolbar of your open notebook in both user interfaces. The bug only appears if you have a kernel that supports debugging (e.g., ipykernel). So if you see the little bug on the right-hand side of the toolbar for your notebook, when you enable it, you should start seeing the variables in your memory state and you should have the ability to click in the gutter to add breakpoints.

Re: Jupyter Notebook 7

#115
post #83

Earlier quoted context omitted.

Neither of those use cases are exclusive to jupyter. You can run scripts on remote machines quite easily, and matplotlib will happily pop up a window for your charts. The real reason is because it’s a much better workflow for data exploration and manipulation because you don’t always know exactly what code to write before you do it. So having the data in memory is really useful.

X forwarding through a terminal session to view that matplotlib plot is a bit more work than most want to deal with. Sure, you can use ranger, and set up the image viewing with uzerbeurg? or something? and set up kitty with icat, but that doesn't work with your tmux, so you have to have a separate ssh window that's not tmux'd, which is annoying and clunky, just for viewing images. You also have to save them, and then…

kitty icat works with tmux, as of kitty 0.28.0 just FYI.

Re: Jupyter Notebook 7

#116
post #94

Earlier quoted context omitted.

Getting paid feels off?

I don't have a great view of how the organization behind Jupyter operates, but I'd be really surprised if they went with Medium as a way to support themselves. What feels off is an open source project (likely by accident or unwittingly) steering users towards giving to a for-profit company.

They are very well funded by numfocus: https://numfocus.org/, at least if going by the names of orgs that are sponsors. I don't think they require any financial benefit from posting things on medium.

It is rather the attitude or non-ideology of the Jupyter contributors/team, that causes things like posting on medium or telling people to post their questions in their discourse forum. It is also reflected in the licensing they chose for their ecosystem. Though usually they are friendly and helpful towards newcomers, it has to be said.

Re: Jupyter Notebook 7

#117
post #60
post #4

> Both Jupyter Notebook and JupyterLab are widely used across data science, machine learning, computational research, and education. Are they though? Does anyone actually use JupyterLab by choice? From what I've seen people love Jupyter Notebook but find JupyterLab misses the mark (and this is certainly my experience).

I have seen the exact opposite. JupyterLab is far more dominant. Including cloud service providers like AWS’ Sagemaker using it as the go to simple data scientist interface. I started strongly advocating for it pretty much immediately. The waste of space on the margins of the notebook view was (is?) awful.

> The waste of space on the margins of the notebook view was (is?) awful.

If that is your only concern, it will probably be quite easy to write a user style sheet to fix it.

Re: Jupyter Notebook 7

#118
post #10

Earlier quoted context omitted.

I've long switched to Emacs/Org, but used JupyterLab extensively before (as a data scientist). It's way more powerful than vanilla notebooks since you can open notebooks/code/related side-by-side, easier to extend (with lab extensions), etc. I always thought people only still used vanilla notebooks because that's what people say they use, e.g. "I work with Jupyter notebooks" (even though that may well be in JupyterLa…

I have used org-mode/babel as a notebook replacement, and obviously the flexibility and the editing capabilities are vastly superior to Jupyter notebook, but I fund it sluggish. I assume that, at least in my setup (using babel-python), the kernel is invoked synchronously. I also didn't try to get any form of completion working, but it should be possible and it would be nice to have. What is your setup?

I use emacs-jupyter, which has async execution. Sorry for the late reply, only just now noticed this!
Post reply on HN