I am applying some functions to pandas dataframe columns as:
def foo(x):
return 1 + x
Then, I apply the function to a column:
df['foo'] = df['a_col'].apply(foo)
How can I return a column with the amount of miliseconds that the function foo
takes to finish?. For instance:
A time_milisecs
2 0.1
4 0.2
4 0.3
3 0.3
4 0.2
Where A
is the column that contains the result of the sum.