File: nbexamples.py

package info (click to toggle)
nbformat 5.10.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,072 kB
  • sloc: python: 4,746; makefile: 167; javascript: 2
file content (14 lines) | stat: -rw-r--r-- 416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from __future__ import annotations

from nbformat.v1.nbbase import new_code_cell, new_notebook, new_text_cell

nb0 = new_notebook()

nb0.cells.append(new_text_cell(text="Some NumPy Examples"))


nb0.cells.append(new_code_cell(code="import numpy", prompt_number=1))

nb0.cells.append(new_code_cell(code="a = numpy.random.rand(100)", prompt_number=2))

nb0.cells.append(new_code_cell(code="print a", prompt_number=3))