|
8 | 8 | "\n",
|
9 | 9 | "This theme has built-in support and special styling for several major visualization libraries in the PyData ecosystem.\n",
|
10 | 10 | "This ensures that the images and output generated by these libraries looks good for both light and dark modes.\n",
|
11 |
| - "Below are examples of each that we use as a benchmark for reference.\n", |
12 |
| - "\n", |
| 11 | + "Below are examples of each that we use as a benchmark for reference." |
| 12 | + ] |
| 13 | + }, |
| 14 | + { |
| 15 | + "cell_type": "markdown", |
| 16 | + "metadata": {}, |
| 17 | + "source": [ |
13 | 18 | "## Pandas"
|
14 | 19 | ]
|
15 | 20 | },
|
|
30 | 35 | "df"
|
31 | 36 | ]
|
32 | 37 | },
|
| 38 | + { |
| 39 | + "cell_type": "markdown", |
| 40 | + "metadata": {}, |
| 41 | + "source": [ |
| 42 | + "## IPyWidget" |
| 43 | + ] |
| 44 | + }, |
| 45 | + { |
| 46 | + "cell_type": "code", |
| 47 | + "execution_count": null, |
| 48 | + "metadata": {}, |
| 49 | + "outputs": [], |
| 50 | + "source": [ |
| 51 | + "import pandas as pd\n", |
| 52 | + "import numpy as np\n", |
| 53 | + "import ipywidgets as widgets\n", |
| 54 | + "from IPython.display import display\n", |
| 55 | + "\n", |
| 56 | + "tab = widgets.Tab()\n", |
| 57 | + "\n", |
| 58 | + "descr_str = \"Hello\"\n", |
| 59 | + "\n", |
| 60 | + "title = widgets.HTML(descr_str)\n", |
| 61 | + "\n", |
| 62 | + "# create output widgets\n", |
| 63 | + "widget_images = widgets.Output()\n", |
| 64 | + "widget_annotations = widgets.Output()\n", |
| 65 | + "\n", |
| 66 | + "# render in output widgets\n", |
| 67 | + "with widget_images:\n", |
| 68 | + " display(pd.DataFrame(np.random.randn(10,10)))\n", |
| 69 | + "with widget_annotations:\n", |
| 70 | + " display(pd.DataFrame(np.random.randn(10,10)))\n", |
| 71 | + "\n", |
| 72 | + "tab.children = [widget_images, widget_annotations]\n", |
| 73 | + "tab.titles = [\"Images\", \"Annotations\"]\n", |
| 74 | + "\n", |
| 75 | + "display(widgets.VBox([title, tab]))" |
| 76 | + ] |
| 77 | + }, |
33 | 78 | {
|
34 | 79 | "cell_type": "markdown",
|
35 | 80 | "metadata": {},
|
|
143 | 188 | },
|
144 | 189 | "language_info": {
|
145 | 190 | "name": "python",
|
146 |
| - "version": "3.10.8" |
| 191 | + "version": "3.11.6" |
147 | 192 | }
|
148 | 193 | },
|
149 | 194 | "nbformat": 4,
|
|
0 commit comments