Attempting to solve an integral using scipy quad to solve for the following:
I have a dataframe with a column of U/Udelta and when trying to apply
delta_115 = 3.41
def d_star_integrand_115(y, df_115, delta_115):
return 1 - df_115['u/u_delta']
d_star_115, error_115 = quad(d_star_integrand_115,
0, delta_115, args=(df_115['u/u_delta'], delta_115)
Could anyone let me know if you can even do an integral of a vectorised column in python or if that is not possible?
Have attempted multiple different options for the integrand, however all lead to the same error:
KeyError: 'u/u_delta'
For reference the entire dataframe looks like this:
The traceback says the keyerror is in
d_star_integrand_115
. The column indexing works ok in thequad
call, but shouldn't be done again.Corrected function