numpy apply_along_axis named arguments

Hi All, I am working with *apply_along_axis* method and I would like to apply a method that requires to pass named arguments (scipy.stats.mstats.mquantiles with prob[]). But currently, it is not possible with *apply_along_axis*. I wonder if it would make sense to add the possibility to pass named arguments. I am also aware that It could be implement using other ways (a loop for each row). That's why I would like to ask whether it makes sense or not to ask for this. Even though, I managed to modify the code, which is simple. http://pastebin.com/pBn0TbgK

Please, find below the patch file for numpy 1.8.0 http://pastebin.com/D33fFpjH On 06/03/14 12:17, Albert Jornet Puig wrote:
Hi All,
I am working with *apply_along_axis* method and I would like to apply a method that requires to pass named arguments (scipy.stats.mstats.mquantiles with prob[]). But currently, it is not possible with *apply_along_axis*.
I wonder if it would make sense to add the possibility to pass named arguments. I am also aware that It could be implement using other ways (a loop for each row). That's why I would like to ask whether it makes sense or not to ask for this.
Even though, I managed to modify the code, which is simple.
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

I am working with *apply_along_axis* method and I would like to apply a method that requires to pass named arguments (scipy.stats.mstats.mquantiles with prob[]). But currently, it is not possible with *apply_along_axis*.
I wonder if it would make sense to add the possibility to pass named arguments. I am also aware that It could be implement using other ways (a loop for each row). That's why I would like to ask whether it makes sense or not to ask for this. I see two alternatives (of course I don't know if it would work for your
Hi, Le 06/03/2014 12:17, Albert Jornet Puig a écrit : particular situation) 1) a wrapper function to make extra arguments disappear, like : my_quantiles = lambda a: scipy.stats.mstats.mquantiles(a, prob=[0.25]) 2) or use directly the `axis` argument of scipy.stats.mstats.mquantiles (that's the simplest, if possible with your usecase) best, Pierre
participants (2)
-
Albert Jornet Puig
-
Pierre Haessig