How to hide cell with code Jupyter notebook - anaconda

I am using jupyter notebook to create a report.I would like when converting the notebook to PDF not to show the code in the PDF file. I have tried using remove_cell in the cell tag. Can anyone help please?

Related

Where are copy-pasted images stored in Jupyter Notebook?

This is very similar to this question but it hasn't been answered.
I launched a Jupyter server from PyCharm. I created a screenshot, and copy and pasted it into a Jupyter Notebook. The image wasn't otherwise saved. In Jupyter Notebook, the image appears like this: ![image.png](attachment:image.png) and I can see the image on the Jupyter server, but I can't see the image in the notebook file in PyCharm. I can't find where the image.png file is stored. I looked through the folder that the notebook is in, and I used the file explorer to check if the image is anywhere on my computer.
Does Jupyter Notebook store the copy-pasted image as a file? and if yes, where?
This answer here fills in some information on what is going on.
When you pasted it into the markdown cell, it got encoded as an attachment in base64 in the cell information for that cell.
If you view the underlying code for the notebook in a text editor you should see encoded data. (You may wish to make a test notebook, separate from the one you care about, and add an image to test that after you save the edited new notebook.)
And so there is no separate saved file.

Tkinter surface is displayed wrong in exe

I'm already trying to fix this for hours but it doesn't work.
I converted my python script to an exe-file. Via pyinstaller and via cx_freeze. But both have the same problem: They display the surface in the wrong way. I include canvas as FigureCanvasTkAgg and when I run it with Spyder it is displayed well. (I tried to place them via .place() and via .pack() ). But with the exe it's all above another and it displays only one of all the canvas (when I enter data for a chart).
Can somebody tell me how to correct this? Is there a way to convert the file to an exe like I can display it via Spyder?
Thank you!!
Displayed in exe: everything is overlapping
Here displayed how it should be

Convert Markdown to pdf with images on mac

This is driving me crazy. I have a jupyter notebook with images and I'm trying to convert it to a pdf on my mac. I've installed pandoc and macTex, but when I try to convert it to pdf the images disappear. Also the formatting for my tables gets messed up. I've tried saving it as a markdown and converting it, but I get the same problem. If I convert to html the images disappear but the table formatting is correct. I've also tried converting it in the terminal with nbconvert, but the images still disappeared. And I tried converting the markdown file with rstudio, but still the images disappeared. I've tried two versions of the code to reference images. The versions are below, both display fine in the jupyter notebook but the first one throws an error and the second one the images disappear. I've googled around, it seems to be a common issue but I'm not seeing a lot of solutions. I really can't believe this is this difficult. Any solution is greatly appreciated.
code with errors:
![Stars_Boxplot](Stars_Boxplot.PNG)
code disappears when rendered:
<img src="Stars_Boxplot.PNG">
Update Solution:
![Stars_Boxplot](/Users/Desktop///Project Research//Stars_Boxplot.PNG)
The issue was it had to be an absolute reference and I had a space in my file path.

Rstudio view() dataframe display nothing

After I upated Rstudio to 1.0.153, I can't view dataframe by function view().
enter image description here
then I updated Rstudio1.1.383, the problem still exists.
I reinstalled the Rstudio, the problem still exists.
My system is windows10
Thank you.

Convert Jupyter notebook to PDF - pdflatex not found on PATH

I'm trying to download my Jupyter notebook as a PDF from the web interface by going to:
File -> Download as -> PDF via LaTeX
However, I get this error:
nbconvert failed: pdflatex not found on PATH
I have both pandoc and MacTex installed. Additionally, in the terminal the pdflatex is set.
$ which pdflatex
/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin/pdflatex
I'm running on Mac OS X El Capitan using Jupyter 4.2.0 with Python 2.7.11
Print it to pdf using your browser (ctrl+p). It is simple and the "you print what you see" approach is great to share a reports/analysis with people that do not code or use the jupyter enviroment. Not publication ready by any means but gets the job done. Just make sure your plots and figures are not on interactive mode otherwise they will not be displayed (set them to %matplotlib inline).
I always had trouble with exporting my jupyter nb to pdf through latex. Quick search and you see that A LOT of people do. I could get some stuff worked out but the formatting was lackluster with code and plots not displayed the way I wanted. I eventually accepted that the jupyter notebook could not produce "publish-ready" pdfs easily. When I want that, I generate plots/figures/code on jupyter and call them on a latex file.
You may want to hide some of your code from the pdf, set the resolution of your plots and add some extensions to improve your jupyter documents.
If you really want to make your publications from inside jupyter, this tutorial has some great tips.
I've had a lot of luck exporting to HTML instead of pdf. HTML is similarly viewable by any non-developers in your organization, assuming they have a browser, and you can make use of some excellent tools like toc2, which gives your viewers a table of contents so they can stay oriented with what they are reading. You can also link to specific sections using the "#" symbol to do header links. Similarly, HTML supports interactive plotting like those available through plotly, so that end-users can zoom into graphs and other figures. Encourage you to give it a shot. Example code with nbconvert below:
jupyter nbconvert --to html --template toc2 --TemplateExporter.exclude_input=True "<path-to-ipynb>"
If its really necessary to have a pdf, you can then open your html in Chrome or Firefox and print to pdf that way. Hope it helps!

Resources