how to run until cell selected INCLUDED in google colab? - google-colaboratory

how to run until cell selected INCLUDED in google colab?
The only thing I've found is this one:
https://stackoverflow.com/a/58959214/15416347
but here the cell selected is NOT INCLUDED

Related

How to add pictures in colab text

I have used Jupyter notebook before and there is no problem to add pictures in the text cells.
In Colab, I have tried all the different ways I can come up with and I have searched the web. I have found a lot of solutions but none work for me. I think that the format of the downloadable link differs from the suggested solutions I have found. I have tried to modify the links in different ways but nothing seems to work.
I Found this in stack overflow: Insert Image in Google Colab Text Cell
I have uploaded my image to Google drive. If I right click the image I can select "Get Link". I think that one shall make the link "Open". Click "Copy link" and return to the markdown cell.
Where you want the image positioned, write "![](https://drive.google.com/uc?id=" then Ctrl + V to add the copied link, but delete all but the bold code as below :
"https://drive.google.com/file/d/1CDIZwkVNiKNmaskHPwnCFTkt-4_RxIhP/view?usp=sharing"
The resulting image link should look something like this:
"![ ] (https://drive.google.com/uc?id=1CDIZwkVNiKNmaskHPwnCFTkt-4_RxIhP)"
(Sorry for my English)
It is only just about adding a !.
Let me give an example,
Add a link.
Paste Image link
Then put ! before link text.(eg ![link text](https://i.example.com/e7e8ea16d242676.png))

Transfer images between Google Sheets?

Is there a way, using the Google Sheets API, to transfer images from one Google Sheet to another that have been added using Insert > Image?
I had a look at the possibilities of Importrange but there doesn't seem to be a way to transfer images using that.
Answer:
Unfortunately, there is currently no way to retrieve images added through Insert > Image via Sheets API, so all you have are several roundabout ways, which will only be appropriate in certain circumstances.
Feature Requests:
There are several feature requests in Issue Tracker regarding image handling in Sheets API, I'd suggest you to star these in order to keep track of them and to help prioritize its implementation:
Retrieve "Image in Cell" cell data on spreadsheets.get endpoint
Insert images to Sheets using the API
Update OverGridImage to support BlobSource interface.
Workarounds:
Option 1. Set image through its URL:
If a URL of the image is available and you want to write the image to a specific cell (not over cells), you could just add the formula =IMAGE(your-image-url) to the desired cell via spreadsheets.values.update.
Or, if you're open to using Apps Script, you could use insertImage(url, column, row).
Option 2. Copy corresponding range:
If the image was added via Insert > Images > Image in cell and the destination sheet is on the same spreadsheet as the source sheet, you could make a CopyPasteRequest or a CutPasteRequest to copy or move the range containing the image to the destination sheet (see spreadsheets.batchUpdate).
Option 3. Copy the entire sheet:
If the image was added via Insert > Images > Image over cells, or if the destination sheet is not on the same spreadsheet as the source sheet, your only option would be to copy the entire sheet via spreadsheets.sheets.copyTo.
You can download a zip file with the sheet in html format using Google API. It will contain all images, no matter how were they added.
Get Your API Key, from Google developers Console
Get a File ID of a google spreadsheet with permissions set to "Anyone with the link".
Now you're ready to call the api (with curl or browser window):
https://www.googleapis.com/drive/v3/files/{FILE_ID}/export?mimeType=application%2Fzip&key={YOUR API KEY}
Remember to fill the above with Your FILE_ID and your API_KEY from google.
This works only for files with "anyone with link" permissions, otherwise you'll have to authenticate first. (see my answer here: How to send google-sheet data in an email keeping the formatting( colors) intact from python?)

Share a unique version of google colab doc?

Does anyone know how exactly I can share a unique version of a google colab doc? I have a colab sheet on my Google Drive and I want to allow for someone to access the file, run, make edits, etc. However, I don't want any of the edits made to be on my version of the doc.
I've searched everywhere...
To share a link to your notebook that allows editing but does not modify your copy, first open the notebook in playground mode using the command palette. (Tools menu -> Command palette)
Then, select the 'Open in playground' command.
This will reload the notebook with a new URL that you can share, allowing others to modify and execute an ephemeral copy of the notebook without modifying the original. If they attempt to save, they will be prompted to create a copy in their own Drive.

How can I preserve cell outputs on uploaded notebooks?

I uploaded a previously created Jupyter notebook. I could initially see all the cell outputs in Colab right after uploading it, but if I close the notebook and come back to it later -- or if I share the notebook with a coworker -- then all the cell outputs have been cleared, which is quite annoying.
This is happening even though I've verified that the following two checkboxes are UNCHECKED:
Edit > Notebook settings > Omit code cell output when saving this notebook
Tools > Preferences > New notebooks use private outputs (omit outputs when saving)
From what I can tell, it looks like the cell outputs get preserved across sessions for notebooks created and edited in Colab, but not for notebooks that were created elsewhere and then uploaded. What am I missing? How can I preserve cell outputs across sessions in uploaded notebooks?
Are you trying to open the file from Drive directly in Jupyter?
If so, you'll need to save the full file using the File -> Download ipynb menu item.
By default, Colab saves outputs using a different format to support incremental saves, so the Drive file created during auto-save will show outputs, but only in Colab itself, and you'll need to download the full ipynb to export to other notebook viewing tools.

hyperlink inserted with pandas need edit before working libreoffice

hyperlink inserted with pandas need edit before working libreoffice:
(using .to_excel in pandas)
hyperlink are ok, but showing 0,
if I add a space, for example, then press Enter, the link will come "alive" and I will be able to click on the hyperlink as normal.
I searched google for any hyperlink issues in libreoffice, and I could not find any that relevant as permission for hyperlink is allowed in my libreoffice.