Creating Multiple .ipynb Notebooks in Google Colab - python

is it possible to create more than the one default notebook in Google Colab Pro?
I first tried to create a new file with the .ipynb file extension and it shows up like this:
Then I tried to create a new notebook like this:
And that file opens up the same way as just creating an new file:
Basically, I'd like to create multiple notebooks like creating an new .ipynb notebook in Jupyter notebooks so I can use Google Colab the same way as Jupyter notebooks. Is this possible in Google Colab?

Google Colaboratory is quite different from jupyter notebook, you can't create and use 2 notebooks in a single session as it would also hurt the resources of the google colab. They do not have made this feature. So it is not possible yet.

Related

Permanently hide cell in Google Colab

I am trying to demo a python package I created. However, it has some sensitive code that I would like to hide. Hence, I am planning to create a Colab notebook and import my github private repo using a personal access token.
I would like to restrict the use of the package only to the Colab notebook and preferably hide the cells when I share the notebook without the option to toggle the hidden cell.
I was not able to find a way. I am open to options.
Thanks in advance

run regular python project (.py) in google colab as notebook (.ipynb)

A project I built with python, I have code in python with (.py) scripts in a folder called "MY_PROJECT", is it possible to run the code in the "MY_PROJECT" folder, in google colab?
I want to run my code in google colab, but it is not in notebook format (.ipynb).
I copied my project to Drive, but I don't see a way to run in colab, Google colab search only for notebook format.
Is it possible to do this, to run a python project in colab?

how to open a jupyter notebook under a folder in google drive?

I am trying to open a existing jupyter notebook from a folder in google drive. In colab, I do:
File-> open notbook-> google drive
Only jupyter notebook files under colab Notebooks are shown, even I have a folder inside Colab Notebooks, that folder is not shown. How can I open the notebook inside a folder?
But if I do below code, I can see all the files under content/drive/MyDrive. But I can only see notebook as a text, see below screenshot for the opened notebook shown on the right hand side. how can I open it a jupyter notebook in colab so I can run the cells? Thanks
# Load the Drive helper and mount
from google.colab import drive
drive.mount('/content/drive')
I usually open these in Colab by right clicking directly in Google drive (not from within Colab itself) and selecting Open with --> Google Colaboratory.

What's the best way of sharing jupyter notebook script with others to be able to run it on their windows computer?

I just wrote a script in jupyer notebook and I'm wondering what's the best format I should save this file as if I want to share it with other people so they can run it on their windows computer? I tried to convert my .ipynb to both .py and .exe, but none seem to work... maybe I'm doing something wrong.
Converting a Jupyter Notebook to a .py or .exe file would make no sense, as notebooks are used for the purpose to execute certain blocks of code on click. You could convert the notebook and it's output to a .pdf File, as you can read here: How to convert IPython notebooks to PDF and HTML?
If you want to port your Jupyter Notebook to a Python file, you'd have to make sure that you include all the code in the .py file, which is written down in the notebook as well. Keep in mind that, when using a regular Python File, things obviously won't look as great as in Jupyter.
The best way to share your Notebooks, would be to send them the actual file, so they can open the notebook in Jupyter notebook, or - in case they don't want to install Jupyter or Python on their device - they could use an online version of Jupyter Notebook like: https://nbviewer.jupyter.org/ - There are multiple websites available, which offer that kind of service.
You can try to use Mercury framework for converting Jupyter Notebook into web application. The Mercury can generate the widgets for your notebook, so don't need to use GUI packages (like tkinter). The widgets are generated by YAML header. Widgets are connected with variables in the notebook code. Your users can change the widgets values and execute the notebook. The final result can be easily exported to PDF. You can read more in the tutorial on how to share Jupyter Notebook with non-technical users.
The example notebook with YAML header
The example notebook converted to web app
Please notice that notebook's code is hidden (show-code: False in the YAML).
The Mercury can be easily deployed to Heroku or any cloud provider (Digital Ocean, GCP, Azure, AWS), please check the docs for details. You just send the server URL to share the app.

Storing Jupyter Notebook Files Online So They Can Be Between Multiple Computers

I'm wondering what the most effective way to store .ipynb notebook files online is so they can be edited between multiple computers.
To clarify, what I'm looking for is something equivalent to overleaf, where all your files are stored online and they can be edited by whichever computer you are using. One possibility I was thinking about was using google drive and storing the files there- then accessing them somehow using jupyter notebook. Does anyone have any recommendations/do this already? I don't know how to access google drive files using jupyter.

Categories