Skip to main content

All Questions

0 votes
0 answers
278 views

KDB type error - whilst using functional select/updates

I have the below two functions - the idea here is that id like to create percentiles of bpsAum for different programmes, i also have another function for bpsTrn, id like the limits table to be one ...
Kieran97C's user avatar
0 votes
2 answers
537 views

How to return each line of a text file using a recursive function?

I am trying to return each line of html.txt: <!DOCTYPE html> <html lang="en" dir="ltr"> <head> My current code is this: def line_out(file): if len(file) == 1:...
Flamenco33's user avatar
1 vote
2 answers
412 views

How to apply a function in an iterable list

so I am new to OCaml and im having some trouble with lists. What I have is a List of chars as follows: let letters = [a;b;c;d] I would like to know how can I iterate the list and apply a fuction that ...
Ugabuga's user avatar
  • 29
0 votes
1 answer
132 views

Iteratively applying a user written function to pairs stored in two different data frame colums

Consider this data: set.seed(123) dat1 <- data.frame(Loc = rep(letters[1:20], each = 10), ID = 1:200, var1 = rnorm(200), var2 = rnorm(200), ...
Ryan's user avatar
  • 1,068
2 votes
1 answer
143 views

Guidelines for specifying variables in a function

Consider dat1 created here: set.seed(123) dat1 <- data.frame(Region = rep(c("r1","r2"), each = 100), State = rep(c("NY","MA","FL","GA"), each = 10), Loc = rep(...
Ryan's user avatar
  • 1,068
3 votes
2 answers
88 views

What's wrong with the logic of this function in R?

I'm tyring to build a function in R which calculates the percentage change between rows based on any arbitrary index, this is, between any given row and the preceding one or any given row and n ...
Alejandro Carrera's user avatar
1 vote
1 answer
48 views

Typescript array of function traversal question

My program has a place where many conditions are checked. As opposed to writing a big if(conditionOne || conditionTwo || ...) type of expressions, I decided to define an array of filters like so: ...
saæ's user avatar
  • 193
-1 votes
2 answers
36 views

Calling Function not Displaying Results

I Create an array of 5 x 5 with random numbers in the following way. #include <iostream> #include <stdlib.h> #include <time.h> using namespace std; int main () { int a[5][5]; ...
Hamza Zafeer's user avatar
  • 2,446
0 votes
2 answers
86 views

Function assigned to list inside of for loop in R

I'm very confused by what's going on in this example. I'm trying to write a function factory and pass it a list of parameters to create a list of functions. I've had luck with this method for ...
brandco's user avatar
  • 320
1 vote
1 answer
67 views

How can i do calculations on subsets , Panda's way, without looping

I have days like this: eventday_idxs 2005-01-07 00:00:00 2005-01-31 00:00:00 2005-02-15 00:00:00 2005-04-18 00:00:00 2005-05-11 00:00:00 2005-08-12 00:00:00 2005-08-15 00:00:00 2005-09-06 00:00:00 ...
Phyo Arkar Lwin's user avatar