I wanted to make my own specified module in Python for scientific work and a crucial step is to design my function. For example, I would like to build a Freundlich adsorption isotherm function: output = K*(c^n), with K and n as constants, c is the concentration of a compound (variable).
def Freundlich(K, c, n):
ads_Freundlich = K * c ** n
return ads_Freundlich
However, with these codes I could only input K, c, n all as single figures. I would like to know how can I run a function by giving the constant(s) as figures and the variable(s) as lists (or pandas series, etc.). In the end, I want the function to return a list. Thanks!
numpy. With lists, you have to do the looping yourself, they do not implement vectorized operations.