Top "Apply" questions

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

Pandas DataFrame use previous row value for complicated 'if' conditions to determine current value

I want to know if there is any faster way to do the following loop? Maybe use apply or rolling …

python pandas dataframe apply
Pandas - combine column values into a list in a new column

I have a Python Pandas dataframe df: d=[['hello',1,'GOOD','long.kw'], [1.2,'chipotle',np.nan,'bingo'], ['various',np.nan,3000,123.456]] t=…

python list pandas lambda apply
Handling NA values in apply and unique

I have a 114 row by 16 column data frame where the rows are individuals, and the columns are either their names …

r unique apply
Trouble passing in lambda to apply for pandas DataFrame

I'm trying to apply a function to all rows of a pandas DataFrame (actually just one column in that DataFrame) …

python pandas dataframe lambda apply
Call apply method with arguments in JavaScript

I wanted to invoke a function using the javascript apply() method. This works fine if the function has no arguments. …

javascript arguments apply
How do I run apply on a data.table?

I have a data.table with columns 2 through 20 as strings with spaces (e.g., "Species Name"). I want to run …

r apply data.table
Why is `vapply` safer than `sapply`?

The documentation says vapply is similar to sapply, but has a pre-specified type of return value, so it can be …

r apply r-faq
Counting the number of rows of a series of csv files

I'm working through an R tutorial and suspect that I have to use one of these functions but I'm not …

r apply lapply
Row/column counter in 'apply' functions

What if one wants to apply a functon i.e. to each row of a matrix, but also wants to …

r apply
Java collection/map apply method equivalent?

I would like to apply a function to a Java collection, in this particular case a map. Is there a …

java collections apply