Skip to content

Instantly share code, notes, and snippets.

@jtpio
Last active August 31, 2021 06:41
Show Gist options
  • Save jtpio/73fdfaa8881f3f68b46173eb8300952f to your computer and use it in GitHub Desktop.
Save jtpio/73fdfaa8881f3f68b46173eb8300952f to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "7e0db5c0-80cc-4c0c-bf11-59bcd6e2f0ba",
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"import ipydatagrid as grid\n",
"import ipywidgets as widgets\n",
"\n",
"np.random.seed(104)\n",
"rang = 100\n",
"df = pd.DataFrame(\n",
" data=[np.random.randint(0, 11, rang) for i in range(rang)],\n",
" index=[f\"Row {i}\" for i in range(rang)],\n",
" columns=[f\"Col {i}\" for i in range(rang)],\n",
")\n",
"\n",
"g = grid.DataGrid(\n",
" df, layout={\"height\": \"1200px\", \"width\": \"800px\"}, selection_mode=\"cell\"\n",
" \n",
")\n",
"display(g)\n",
"display(g)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
voila==0.2.10
ipydatagrid==1.1.5
jupyterlab==3.1.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment