Top "Apply" questions

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

Python pandas apply function if a column value is not NULL

I have a dataframe (in Python 2.7, pandas 0.15.0): df= A B C 0 NaN 11 NaN 1 two NaN ['foo', 'bar'] 2 three 33 NaN I …

python list pandas null apply
pandas apply function that returns multiple values to rows in pandas dataframe

I have a dataframe with a timeindex and 3 columns containing the coordinates of a 3D vector: x y z ts 2014…

python pandas dataframe apply iterable-unpacking
How does the Math.max.apply() work?

How does the Math.max.apply() work?. <!DOCTYPE html> <html> <head> <meta charset=…

javascript function apply
subset a column in data frame based on another data frame/list

I have the following table1 which is a data frame composed of 6 columns and 8083 rows. Below I am displaying the …

r subset apply
Dataframe create new column based on other columns

I have a dataframe: df <- data.frame('a'=c(1,2,3,4,5), 'b'=c(1,20,3,4,50)) df a b 1 1 1 2 2 20 3 3 3 4 4 4 5 5 50 and I want to …

r dataframe apply
How to apply function over each matrix element's indices

I am wondering if there is a built-in function in R which applies a function to each element of the …

r function dictionary matrix apply
How to paste a string on each element of a vector of strings using apply in R?

I have a vector of strings. d <- c("Mon","Tues","Wednes","Thurs","Fri","Satur","Sun") for which I …

r paste apply
Apply function to each cell in DataFrame

I have a dataframe that may look like this: A B C foo bar foo bar bar foo foo bar …

python pandas dataframe apply
Concatenate row-wise across specific columns of dataframe

I have a data frame with columns that, when concatenated (row-wise) as a string, would allow me to partition the …

r apply paste string-concatenation sapply
How do I wrap a function in Javascript?

I'm writing a global error handling "module" for one of my applications. One of the features I want to have …

javascript function try-catch apply wrapper