Hacker News new | past | comments | ask | show | jobs | submit login

Is there (or are there plans for) a version of this in Jupyter notebooks?



No, because I don't use Jupyter notebooks.


I don't see how there would be a need for that. The code will work in Jupyter Notebooks just as it will work in a different IDE.

I came from Python using iPython. I missed them for the first few weeks, but now I can't switch from RStudio. It really is just such a great tool for data science.


The advantage of Jupyter notebooks over RStudio is having text and code in the same place. Personally, I find that being able to run+modify the code in a textbook is much more informative than simply reading the syntax (for example - https://github.com/CamDavidsonPilon/Probabilistic-Programmin...). Sure, I could just copy and paste from the website into an IDE, but notebooks are a more natural way of communicating code and prose, IMO.


In R we also have notebooks that does this just it is slightly different. RMarkdown is how we do this same thing. At first I missed the different code and text blocks but it is just easier to work with when it is all a text file. You can make the RMarkdown for reports and then just run them from the command line and never have to open RStudio or R. Saves me a ton of time.

You use back ticks to make your code chunks.

For example: Some random Markdown text here is treated as a text block in Juypter

```{r}

summary(cars)

```

Then some further text goes here.

http://rmarkdown.rstudio.com/index.html


I agree, though I don't know if I'm just missing something when working in Jupyter, or if Python has an equivalent of RMarkdown?

Jupyter has some conveniences, but the tradeoffs aren't worth it for me. Working in a web browser has much less power, when it comes to keyboarding, than Atom/Sublime. And I generally don't need to interact with my data; I know what I'm outputting, I just want to show the results to readers alongside my code. I don't use RStudio but RMarkdown is easy to run from the command line.

By contrast, Jupyter requires (AFAIK) working within the browser and, when you save the file, you get a huge jumble of JSON, which is how the notebook is serialized. I tend to write a lot of vignettes/explorations and the need to full-text grep them is important to me and is not feasible when the text content is saved as JSON.


>Jupyter, or if Python has an equivalent of RMarkdown?

You can convert the Notebooks to different formats. Though they tend to have to be fixed up a bit for a script (Which I also might need to in R to turn it into a script)

https://ipython.org/ipython-doc/3/notebook/nbconvert.html


The source is available in https://github.com/hadley/r4ds, and works exactly as you describe when using the preview edition of RStudio (and indeed that's how I write the book)


I just saw this the other day! This wrapper around Pandoc to make life our lifes easier (tidyr)? I just went through the process of making a markdown file to an epub before I saw this, wish I saw this earlier.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: