Consider the following pandas DataFrame:
df = pd.DataFrame([[[1, 2, 3]], [[4, 5, 6]], [[7, 8, 9]], [[0, 1, 2]]], columns=['a']) a
| import streamlit as st | |
| import aiohttp | |
| import asyncio | |
| async def fetch(session, url): | |
| try: | |
| async with session.get(url) as response: | |
| result = await response.json() | |
| return result |
| # For single-node, run this script via | |
| # python -m torch.distributed.launch --nproc_per_node=<ngpus this node> example.py | |
| # | |
| # For multinode, see https://pytorch.org/docs/stable/distributed.html#launch-utility | |
| # | |
| # Example showing native mixed precision tools | |
| # (torch.cuda.amp.GradScaler and torch.cuda.amp.autocast) | |
| # used along with native DistributedDataParallel to perform | |
| # gradient accumulation with allreduces only when stepping. | |
| # |
This gist is forked from pbugnion's great work on building a searchable multi-checkbox using ipywidgets. You can find that work in this gist.
This version adds compatability with Jupyter Widgets' interactive_output() function, and also makes it easier to see which elements were selected by sorting them to the top. It also makes a few small changes to enable this to work in Jupyter Lab.
| import cv2 | |
| import pytesseract | |
| import urllib | |
| import numpy as np | |
| import re | |
| # Installs: https://www.learnopencv.com/deep-learning-based-text-recognition-ocr-using-tesseract-and-opencv/ | |
| if __name__ == '__main__': | |
| """ | |
| Lyle Scott, III // [email protected] | |
| Multiple ways to rotate a 2D point around the origin / a point. | |
| Timer benchmark results @ https://gist.github.com/LyleScott/d17e9d314fbe6fc29767d8c5c029c362 | |
| """ | |
| from __future__ import print_function | |
| import math |