摘要:
How to calculate df.cummin() piecewise I want to start df.cummin() when cond column is true until recompute df.cummin() next cond column is true. The 阅读全文
摘要:
%%timeit def compare(A, B): x = A[0] out = [] for a,b in zip(A,B): if b>x: out.append(True) x = a else: out.append(False) return out df['compare'] = c 阅读全文
摘要:
我们可以使用 numba解决方案: from numba import jit @jit def dyn_shift(s, step): assert len(s) == len(step), "[s] and [step] should have the same length" assert i 阅读全文