Ask Your Question

orkolorko's profile - activity

2017-08-04 22:14:11 +0200 answered a question How do I profile with %lprun in Cocalc?

Found an alternative solution, this snippet does line profiling of f and of the function g called inside f

def f(a,b,c):
     y=g(b,c)
     return a,y

from line_profiler import LineProfiler

lp = LineProfiler()
lp.add_function(g)
lp_wrapper = lp(f)

s,t = lp_wrapper(a,b,c)
lp.print_stats()
2017-08-04 22:14:11 +0200 asked a question How do I profile with %lprun in Cocalc?

Hi, I'm trying to profile using %lprun in Cocalc, but it says that the decorator is not defined. How do I import it?

Best wishes Isaia