Saved Jupiter notebook to strange format - python

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.

Related

ipynb file does not open anymore

I was working on a ipynb in pycharm. And suddenly I'm not able anymore to open that file. I can see raw code with a text editor like sublime and pasting it in online validator I get this error. How can I find a solution? I'm worried that I've lost everythng.

Jupiter notebook stuck

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.

how to get the JSON code of a .ipynb file?

I have a problem when I try to open an Ipynb file in Jupyter lab, I get this error :
Unreadable notebook [...] NotJSONError("Notebook does not appear to be JSON: ''...")
I get this error even if I create the file with Jupyter lab directly
I already tried to update Jupyter and to update Nodejs but nothing change.
Before I had this problem I didn't even know that ipynb files were made with JSON so I am a bit lost.
does anyone know how I can get the JSON code of my Ipynb file?
You can validate the .ipynb file with a JSON validator: like this one

How to upload over 1000 MB data files into jupyter notebook and still be able to run my notebooks?

Question is in the title. Basically, I want to analyze a large data file but I can't do that since I can't even run the python 3 notebook that analyzes that file. If I delete that large data file, I can run that same python 3 notebook looking at a smaller file no problem.
Some more background information on my issue:
My file never actually uploads all the way to 100%
I can't even open a new notebook that has nothing to do with that file.

Unreadable Notebook: C:\file path UnicodeDecodeError('utf-8) for Jupyter Notebook

I am trying to open a notebook file that I was working on 3 days ago, however, I get the following error Unreadable Notebook: C:\file path UnicodeDecodeError('utf-8) for Jupyter Notebook. How can I get this file to work again.
I've reinstalled Anaconda and tried opening the file on different computers but it still doesn't work
I just had this problem and this is what worked for me.
Open the problem notebook in a text editor and copy all the text. Open a new file in your text editor and paste in the text, then save the file. In my case the text editor did not have the option to save as a Jupyter Notebook, so I saved as .txt.
Move the file into your Jupyter area. Rename it so the ending is .ipynb and not .txt. Then open the file as a notebook.
As I read through the now-working notebook I saw some comments had what looked like Chinese characters in them. I don't know exactly what happened there to make those appear but if you used Ctrl+/ to comment like I do then it's possible that is where the issue is in your notebook. So if my janky method of converting file types does not work for you and you still really want to save your notebook enough to manually dig through all the markup and text then you can try checking your comments in the file to see if there are odd characters in there.

Categories