Skip to content

Instantly share code, notes, and snippets.

@simecek
Created August 18, 2020 14:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simecek/0ee10e9d1fbc54c156b566386ca6806f to your computer and use it in GitHub Desktop.
Save simecek/0ee10e9d1fbc54c156b566386ca6806f to your computer and use it in GitHub Desktop.
Tqdm_nested_loops.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Tqdm_nested_loops.ipynb",
"provenance": [],
"collapsed_sections": [],
"authorship_tag": "ABX9TyMpxqriWtcYWGX+vHeZeQUz",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/simecek/0ee10e9d1fbc54c156b566386ca6806f/tqdm_nested_loops.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"metadata": {
"id": "onV5XiVy__ux",
"colab_type": "code",
"colab": {}
},
"source": [
"from tqdm.notebook import tqdm"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "CjagutS-AMIa",
"colab_type": "code",
"colab": {}
},
"source": [
"k = 0\n",
"\n",
"for outer_loop in tqdm(range(20), desc='outer loop', leave=True):\n",
" for inner_loop in tqdm(range(10_000_000), desc='inner loop', leave=False):\n",
" k += 100"
],
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment