Questions tagged [replicate]
280 questions
0
votes
1 answer
ClusterBootstrap::clusbootglm() taking long time to run
I am using the clusbootglm() function from the ClusterBootstrap package. It is taking an unusually long amount of time to run this. The dataframe only contains 900 rows and 4 columns.
clusfunc <- function(df1) {
mod1 <- clusbootglm(y ~ treat + u,…

melbez
- 960
- 1
- 13
- 36
0
votes
1 answer
How to keep SQL data and Elasticsearch in-sync, and which to search from?
I've seen two solutions mentioned, and was wondering what most people do.
Use logstash
Code your application to make writes to Elasticsearch alongside SQL. For example,
public saveRecord() {
saveToElasticsearch();
saveToSQL();
}
Another…

user11461913
- 33
- 3
0
votes
1 answer
How to prevent usage of loop using `replicate`
I'm trying to simplify code looking like this
someFunc <- function(x) {
return(x + 3L)
}
x <- 1L
for (i in 1:10) {
x <- c(x, someFunc(x[length(x)]))
}
I was thinking about reduce like this
replicate(10, x <- c(x, someFunc(x[length(x)]))
but…

s1624210
- 627
- 4
- 11
0
votes
1 answer
SQL REPLICATE() function not replicating and simply returning a single instance of the provided string when assigning to variable
I'm currently trying to solve an SQL programming challenge (building a triangular structure using asterisk characters). Example output below (3 rows);
* * *
* *
*
I have written code which I believe should work (coming from some hobby C#…

Ash Edwards
- 3
- 1
0
votes
1 answer
Pandas drop.duplicate function doesn't work as expected
I am currently working on different data frames that I should merge. One of my data frame has many duplicates on my key of merge variable, so I used drop.duplicate to remove them.
Later checked the shape of my data frame before (it had 531 rows) and…

Grison Mayliss
- 33
- 4
0
votes
2 answers
Accessing a variable inside a function for calculation
I am trying to access a variable from inside a function and its giving me an error which says:
NameError: name 'perm_sample_1' is not defined
Code is here:
def permutation_sample(data1,data2):
data = np.concatenate((data1,data2))
…

John Doe
- 637
- 2
- 7
- 14
0
votes
1 answer
Copy tensor using K.tile()
I have tensor (None, 196) and after reshaping, it becomes (None, 14, 14).
And now, I want to copy it to channel axis, so that the shape should be (None, 14, 14, 512). Lastly, I want to copy to timestep axis, so it becomes (None, 10, 14, 14, 512). I…

donto
- 141
- 1
- 12
0
votes
2 answers
How to replicate one year daily data to multiple years taking into account leap years?
I have 365 daily values from one year. Now I want to replicate these values for the year from 2014 to 2018. If there is a leap year, give February 29 the average value of February 28 and March 01.
How could I do this automatically? This is what I…

IloveCatRPython
- 631
- 8
- 20
0
votes
1 answer
I am trying to form 7 groups of random number of observations from a total of 100 observations. All observations should be used
I am trying to create a list of 7 groups with 100 observations. Each group can have different number of observations. All observations should be placed in one of the 7 groups. In other words, all observations should be used.
The code I am using…

Shand
- 41
- 1
- 5
0
votes
2 answers
How to calculate the average of experimental values of replicates of the same sample, without knowing the number of replicates ahead?
I have a csv file with a data set of experimental values of many samples, and sometimes replicates of the same sample. For the replicates I only take into account the mean value of the replicates belonging to the same sample. The problem is, the…

Armelle Quinn
- 67
- 5
0
votes
1 answer
Replicate and append to dataframe in R
I believe this is fairly simple, although I am new to using R and code. I have a dataset which has a single row for each rodent trap site. There were however, 8 occasions of trapping over 4 years. What I wish to do is to expand the trap site data…

DidDrog11
- 51
- 6
0
votes
2 answers
Generate distribution based on mean and sd multiple times for different groups
I have a dataframe composed of a grouping variable, mean, and sd. I'd like to generate a number of means (eg., 10) for each group based on their group mean and sd. I can do this using rnorm coupled with the dplyr function "mutate", but I'm having…

RyanStephens
- 27
- 1
- 4
0
votes
1 answer
How to point to source url in couchdb replicate?
I have a local PouchDB that must sync with a remote CouchDB. I'm trying (so far without success) to replicate the local one (on localhost:8081) to the remote one (on localhost:5984) through a POST call to /_replicate.
No matter what I enter in the…

Sipann
- 138
- 6
0
votes
0 answers
Replicate Eloquent in Laravel with changing some columns
I'm using the replicate eloquent and it doesn't work on me. Replicate the row in database with changing some columns and it will save by clicking the button, can you please help me?
My coding for controller
public function newpayrolls(Request…

shyy
- 17
- 4
0
votes
1 answer
how to "replicate" a select statement in SQL Server?
I need to do an insert into a table with the following SELECT:
select 1001, '2021-Q1', null, null
union
select 1001, '2021-Q2', null, null
union
select 1001, '2021-Q3', null, null
union
select 1001, '2021-Q4', null, null
I need to do this until I…

JJ.
- 9,580
- 37
- 116
- 189