Jupiter notebook stuck - python

I am trying to open a Jupyter notebook I have done, but since when I uploaded a huge dataframe it is stuck like this:
I don't know what to do actually. I have tried to ctrl+C (force quit) jupyter and restart it again several times. I have an important code there. Is there a way to recover it or open the page? I know it's not very much info. This notebook is stored in an anaconda environment and for the moment I did nothing but trying to open it....it looks like jupyter is very slow down.
EDIT: it looks like it is very memory expensive...
Thank you,
Federico

Jupyter notebooks are actually JSON files, so you can open them with plain text editors. Presumably, your browser is having a hard time rendering the notebook - opening it in a text editor won't render anything at all, so you should be able to read the code.
This will allow you to back up the code of the notebook.

Related

Saved Jupiter notebook to strange format

I have been learning python for a year. Yesterday I was working on a project for many hours, and I was constantly clicking the save button. In the end, I tried to download the notebook as a pdf file unsuccessfully, but it was very late and gave up.
Today I went to the Jupyter notebook and 2/3 of the work was not there!. It says last checkpoint 19 pm but I went to sleep (and saved the file numerous times) at 4 am.
On the other hand, I am finding a lot of files with format .1 (never seen this before) with the name of the original file, however, when I open them I see endless lines of JSON code of what I believe is the work I was doing yesterday, just in an unworkable format.
THis is a capture of the type of file I saved
Does anybody know what happened here and what I can do to recover the original code?
Thank you so much.
The file in the screenshot looks like a Jupyter file (Jupyter notebooks are saved in the JSON format). Try to change the extension to .ipynb and open it in Jupyter Notebook.

Trusting a notebook is not working in PyCharm

I want to run a Jupyter notebook in PyCharm but on cells that are executing javascript, I get the message, that the notebook is not trusted.
When I click the "Trusted" checkbox, the arrow appears for a second and then disappears again. The notebook stays untrusted. Also using the command-line interface for Jupyter with
jupyter trust notebook.ipynb
doesn't work.
When I open the notebook on the browser with the same kernel running, it works just fine.
I also want to add that I have three projects open at the same time. When I just open the project, which is containing the notebook, I can click the "Trusted" checkbox and it will stay checked, but still, the javascript cells will not execute.
Maybe that's a bug, but probably I messed up some settings? Can you help me find out, which settings I can change and if there are other options to get the notebook trusted within the IDE?
Have a nice day!
I had the same problem when I moved the notebook's directory. What solved it for me in PyCharm was to copy and paste the notebook's content into a new file.
I came across this issue when specifying %matplotlib notebook.
Changing this to %matplotlib inline got the plotting to work.
Not fully understanding the issue or how this solves it but it is sufficient for my application.

how to open jupyter projects on anyother IDE like vs_code

I am working with Juypter Notebook for a long time and I want to open my projects in vs_code (or any other IDE) and my "juypter_projects" folder where I contain all my Jupyter notebook projects appears in this way: (please try to understand my handwriting 😀😁)
and inside the .ipynb_checkpoints folder which is located inside the juypter_projects folder seems in this way:
and looks like none of the files inside these folders are of .py extension
hence so I dont know which file should I choose to open when trying to edit my code in other IDEs
and so when I tried to open them in any IDE like vs_code it is not working and this limits me to only edit my code inside "Juypter Notebook" and please tell me how can I open Juptyer Notebook projects and edit them in other IDEs... Thank You
When you write code in Jupyter cells, the notebook (.ipynb) is converted into a JSON object, making it very difficult to work in an IDE.
The solution my company landed on is writing everything in external python modules and importing them into the notebook. We use Jupyter widgets extensively and they can be imported into .py files as easily as importing them into notebooks. In the end, we get a library of custom widgets and modules that can be used by everyone, and since it's just python, we can build/edit in any IDE. I use Sublime.
There may be other ways, but this approach works so well for us that we've stopped looking for alternatives.

Recovering Jupyter Notebook files after computer crashed?

I use Jupyter Notebooks (run through Anaconda) to code in Python. Last week, my computer crashed (not really sure the exact reason), I sent it for repairs and got it back and it has been basically completely reset and now all my apps/files are gone (repair invoice says a "part" was replaced, but not what part).
My question: is there any way to recover my jupyter notebook files or are they completely gone? I've seen instructions to recover accidentally deleted notebooks but not sure if there is a way to recover files after a computer crash. I am using Windows if that helps at all.
If it's not possible to recover these files, what is the best way to back them up in the future? I was under the impression that since jupyter notebooks opened on a web browser, the files would be stored on some sort of cloud, but it appears that is not the case.

Make Jupyter Notebook clickable

I did develop an application for several users on windows, without internet access using python and Jupyter Notebook as a graphical interface.
The application intend to process some data, they just have to copy paste the path to their datafile and run through different step.
As a user they just want to double click somewhere to open it. I may not fully understand Jupyter Notebook but I would like to find a simple way to make the notebook clickable ...
Could you help me ?
Thx
Have you looked at nteract? It was a suggestion in a similar question here, that was linked from a question with a similar title as yours, but referenced the previous version of the tech that is now Jupyter notebook.

Categories