A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| from functools import wraps | |
| from timeit import default_timer | |
| import gevent | |
| from gevent.queue import Queue | |
| def gevent_throttle(calls_per_sec=0): | |
| """Decorates a Greenlet function for throttling.""" | |
| interval = 1. / calls_per_sec if calls_per_sec else 0 | |
| def decorate(func): | |
| blocked = [False] # has to be a list to not get localised inside the while loop |