memory = joblib.Memory(cachedir=tempfile.mkdtemp(), verbose=0)

@memory.cache
def run(x):
    print('called with {}'.format(x))
return x
run(1)
run(2)
run(3)
run(2)
run.call(2)
Selective Re-Memoization of DataFrames