Created
August 18, 2020 14:49
-
-
Save simecek/0ee10e9d1fbc54c156b566386ca6806f to your computer and use it in GitHub Desktop.
Tqdm_nested_loops.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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