Google Colab - Exporting to a PDF Format!

preview_player
Показать описание
Brief tutorial on exporting a Google Colab Notebook to a PDF File using nbconvert. The video goes through two methods: exporting to HTML then to PDF format and exporting directly to PDF format. The code for each can be found below.

Method 1:
!jupyter nbconvert --to html /content/KNN.ipynb

Method 2:
!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic
!jupyter nbconvert --to pdf /content/KNN.ipynb

The notebook can be found in the "Google Colab Tutorials" folder within the below repo.

CONNECT:

|-Video Chapters-|
0:00 - Intro
0:13 - Issue with printing notebook to PDF
0:46 - nbconvert package
1:07 - Uploading file to content folder
1:24 - Method 1: Converting the notebook to HTML then printing to PDF format
3:31 - Method 2: Directly converting the notebook to PDF format
5:33 - References
Комментарии
Автор

This is absolutely great! You started off by addressing the number 1 problem in printing directly from Colab. You helped me a lot! Thank you Adrian

sbzguadafoc
Автор

This is probably one of the best videos on Youtube!

lowpompuli
Автор

Thanks for such a helpful and comprehensive walkthrough!

peytonpolitewicz
Автор

😄thanks dude, I was trying to create it pdf but was just getting a pdf in black and white, now I can make pdf in a great coloured quality....🙏

AdityaGupta-wtsm
Автор

Amazing!! Thank you! The second method worked for me, to convert Colab notebooks to PDFs. Finally..

KarmaTrain
Автор

Adrian Dolinay is the best Python channel on YouTube

blenklofman
Автор

This is so awesome. I wish I had learned this years ago!

spencerhalverson
Автор

this tutorial really helped me, thank you!

novadwilestari
Автор

How are you dragging and dropping the file?

njerimuchiri
Автор

my plotly visuals are not visible in the pdf, what can be the reason for this?

ajitjadhav
Автор

This is amazing!!! My TA told me just print it which mess all my graphs

menkiguo
Автор

Thanks a lot. This is was very useful for my to submit my assignment.

ravinathaariyarathna
Автор

Just what I was looking for - thanks so much!

MrJdubs
Автор

Hey there, thanks for the video!

In case someone is interested how to refer directly to a file residing on Google Drive, here is the command:

from google.colab import drive
drive.mount('./mount')

!jupyter nbconvert --to html 'mount/My Drive/Colab Notebooks/NameOfFile.ipynb'

Razer
Автор

Many thanks, Adrian. I really appreciate your explanation.

sirginirgin
Автор

Excelent! That was very helpful to me.

camilacoutodacosta
Автор

Thanks. Pycharm Professional makes it difficult to extract pdfs of jupyter notebook. I don't want to have to go back and forth to colab just to generate pdfs. I used the HTML method you described in this video and it worked perfectly. Thanks!

evanmhowington
Автор

Thanks!

This got rid of multiple issues for me when printing directly from Colab.
- output cells with scroll bar get truncated.
- missing pages/charts for long notebooks

MrKiranmehta
Автор

Thanks for sharing... This was usefull for my project idea... Thanks a lot

shahrizal
Автор

Hi Adrian, I have some visuals also in my python file and they are excluded in the pdf while converting by the second method. Any possible way to add visuals also in PDF?

datayogi_