Jupyter Notebook: Difference between revisions
No edit summary |
No edit summary |
||
Line 38: | Line 38: | ||
["Mars",3390,641.85]] | ["Mars",3390,641.85]] | ||
display(HTML(tabulate.tabulate(table, tablefmt='html'))) | display(HTML(tabulate.tabulate(table, tablefmt='html'))) | ||
</pre> | |||
== Google Collaboratory Oddities == | |||
Google colaboratory is like a hosted jupyter labs that has gdrive integrated. This can be handy but there are some adjustments required. | |||
As part of the setup process you will need to "enable the app". I did this by right cliking in gdrive on an ipynb file and choosing "add app". | |||
search "Colaboratory" | |||
https://colab.research.google.com/ | |||
Also you may need to give Colaboraty access to you gdrive. | |||
<FIXME : how ? > | |||
You can "mount" your gdrive in you ipynb files like this: | |||
<pre> | |||
from google.colab import drive | |||
drive.mount('/content/gdrive') | |||
</pre> | |||
you be funniny an ipynb file form a subdirectory of your gdrive , but when you open() a data file in the same folder you might get "file not found". | |||
To fix this change your working dirrectory: | |||
not like this: | |||
<pre> | |||
!cd gdrive/path/to/file | |||
</pre> | |||
but like thisL: | |||
<pre> | |||
%cd gdrive/path/to/file | |||
#Z and see the change with | |||
!pwd | |||
</pre> | </pre> |
Revision as of 16:39, 13 December 2021
- install ( mac)
pip install jupyterlab
- run
jupyter notebook --no-browser --ip 0.0.0.0 --port 5000
jupyter notebook --no-browser --ip 0.0.0.0 --port 5000 --log-level=DEBUG
inline image:
possibly this:
%matplotlib inline
possibly this:
from IPython.display import Image
To Read
https://voila.readthedocs.io/en/stable/index.html
Tables in put put
ref: https://stackoverflow.com/questions/35160256/how-do-i-output-lists-as-a-table-in-jupyter-notebook
also: https://pypi.python.org/pypi/tabulate
from IPython.display import HTML, display import tabulate table = [["Sun",696000,1989100000], ["Earth",6371,5973.6], ["Moon",1737,73.5], ["Mars",3390,641.85]] display(HTML(tabulate.tabulate(table, tablefmt='html')))
Google Collaboratory Oddities
Google colaboratory is like a hosted jupyter labs that has gdrive integrated. This can be handy but there are some adjustments required.
As part of the setup process you will need to "enable the app". I did this by right cliking in gdrive on an ipynb file and choosing "add app".
search "Colaboratory"
https://colab.research.google.com/
Also you may need to give Colaboraty access to you gdrive.
<FIXME : how ? >
You can "mount" your gdrive in you ipynb files like this:
from google.colab import drive drive.mount('/content/gdrive')
you be funniny an ipynb file form a subdirectory of your gdrive , but when you open() a data file in the same folder you might get "file not found".
To fix this change your working dirrectory:
not like this:
!cd gdrive/path/to/file
but like thisL:
%cd gdrive/path/to/file #Z and see the change with !pwd