Top "Apply" questions

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

Why does as.factor return a character when used inside apply?

I want to convert variables into factors using apply(): a <- data.frame(x1 = rnorm(100), x2 = sample(c("a","…

r apply r-factor
pandas apply typeError: 'float' object is not subscriptable

I have a dataframe df_tr like this: item_id target target_sum target_count 0 0 0 1 50 1 0 0 1 50 I'm trying to find the …

python pandas apply series array-broadcasting
Including the group name in the apply function pandas python

Is there away to specify to the groupby() call to use the group name in the apply() lambda function? Similar …

python pandas pandas-groupby apply
How to read in multiple data tables into R using apply function?

I am relatively new to R and I'm having a problem reading in multiple tables from a directory using an …

r apply lapply read.table
weighted means by group and column

I wish to obtain weighted means by group for each of several (actually about 60) columns. This question is very similar …

r for-loop apply sapply
Parallelize pandas apply

New to pandas, I already want to parallelize a row-wise apply operation. So far I found Parallelize apply after pandas …

python pandas parallel-processing apply embarrassingly-parallel
Remove/collapse consecutive duplicate values in sequence

I have the following dataframe: a a a b c c d e a a b b b e e …

r loops apply lag
Why does pandas apply calculate twice

I'm using the apply method on a panda's DataFrame object. When my DataFrame has a single column, it appears that …

python pandas apply
Backbone - Object render has no method 'apply'

I am getting the error: object render has no method apply for the below code. What can be the reason ? …

jquery backbone.js apply nomethoderror
Apply a list of n functions to each row of a dataframe?

I have a list of functions funs <- list(fn1 = function(x) x^2, fn2 = function(x) x^3, fn3 = function(…

r apply plyr