Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

401
Views
Can you embed a YouTube video in a Jupyter Notebook?

I am trying to embed a YouTube video into an existing Jupyter notebook, using the embed code and an iframe. I have seen a few other solutions where they use a code cell which is then executed - but this is not desirable, as outlined below.

I would like to embed the iframe directly into a markdown cell in the notebooks. This way we can re-use the same notebook markdown with a variety of kernels without having to change the code cells.

Do you know if this is possible or not? Does it require installing any additional tools (e.g. Node.js)?


For a minimal example, suppose I wanted to embed this code in a markdown cell:

<iframe width="560" height="315" src="https://www.youtube.com/embed/jZ952vChhuI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

If I include it in a markdown cell as follows:

# My Markdown Video

This is where the video should go:

<iframe width="560" height="315" src="https://www.youtube.com/embed/jZ952vChhuI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>```

But it's not here.

However, when this markdown cell is rendered (run) the iframe does not show up; it's just a blank. It will display if you try to print the notebook, but it's not interactive.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Not in markdown but you can use %%html at the top of a code block that doesn't mind what kernel type you're using to embed the video:

%%html
<iframe width="560" height="315" src="https://www.youtube.com/embed/jZ952vChhuI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!