Top "Apply" questions

A function to call another function with a list of arguments.

Why doesn't Array.push.apply work?

As described here, a quick way to append array b to array a in javascript is a.push.apply(a, …

javascript arrays apply
calculate row sum and product in data.frame

I would like to append a columns to my data.frame in R that contain row sums and products Consider …

r dataframe apply
How can I call a javascript constructor using call or apply?

How could I generalise the function below to take N arguments? (Using call or apply?) Is there a programmatic way …

javascript call apply
How does require() in node.js work?

I tried this: // mod.js var a = 1; this.b = 2; exports.c = 3; // test.js var mod = require('./mod.js'); console.…

javascript node.js this require apply
Pandas Rolling Apply custom

I have been following a similar answer here, but I have some questions when using sklearn and rolling apply. I …

python pandas apply
Loop over rows of dataframe applying function with if-statement

I'm new to R and I'm trying to sum 2 columns of a given dataframe, if both the elements to be …

r loops if-statement dataframe apply
use multiple columns as variables with sapply

I have a dataframe and I would like to apply a function that takes the values of three columns and …

r dataframe apply
Apply function on each row (row-wise) of a NumPy array

So, I have the function - def function(x): x , y = vector return exp(((-x**2/200))-0.5*(y+0.05*(x**2) - 100*0.05)**2) and …

python arrays numpy apply
Why are loops slow in R?

I know that loops are slow in R and that I should try to do things in a vectorised manner …

performance r apply
Use Pandas groupby() + apply() with arguments

I would like to use df.groupby() in combination with apply() to apply a function to each row per group. …

python pandas dataframe apply pandas-groupby