minima

finding conditional local minima values in time series python

霸气de小男生 提交于 2019-12-31 04:13:09
问题 For a time series dataset: A, How do I find the local minima (nadir values) for each ID? (local mins) B, How do I find any subsequent values that are 2 greater than each local minima. (local mins + 2) import pandas as pd df = pd.DataFrame({'id': [1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2], 'value': [8,5,3,2,1,2,3,5, 1.5, 3, 1, 1.5, 2, 3, 4, 0.4]}) For A, I was able to use the following code to find all the nadir/local minimum values from the dataset, but they are not grouped by each id. How do I modify

Adding of any html file from the minima/_includes directory into the website directory cause the github build to fail

廉价感情. 提交于 2019-12-08 05:26:55
问题 I wanted to override/change certain things in head.html so I copied to over https://github.com/jekyll/minima/blob/master/_includes/head.html to my website directory and built it (jekyll clean + build) - this worked fine in my local but on pushing the same to github the build fails with no particular error. Here is my commit that fails in github This where i reported it. Generic error that i get - The page build failed for the master branch with the following error: Page build failed. For more

Find n minimum values in an array

混江龙づ霸主 提交于 2019-11-28 12:20:52
I am using Matlab 2012a. I have an array of k cells (say 1000). I need to find the 5 lowest values of this array and need to do an average of those values in X and Y. Anyone has an idea how to do that? Assuming you have arrays X and Y, and you want to find the five lowest Y values: [m mi] = sort(Y); lowest5index = mi(1:5); lowest5Y = Y(lowest5index); lowest5X = X(lowest5index); meanYlowest5 = mean(lowest5Y); meanXlowest5 = mean(lowest5X); Explanation: The sort command with two output parameters returns both the sorted array (in m ) and the indices in the original array ( mi ). The first five

Finding local maxima and minima in R

你说的曾经没有我的故事 提交于 2019-11-28 10:22:25
问题 I'm trying to create a function to find a "maxima" and "minima". I have the following data: y 157 144 80 106 124 46 207 188 190 208 143 170 162 178 155 163 162 149 135 160 149 147 133 146 126 120 151 74 122 145 160 155 173 126 172 93 I have tried this function to find "maxima" localMaxima <- function(x) { # Use -Inf instead if x is numeric (non-integer) y <- diff(c(-.Machine$integer.max, x)) > 0L rle(y)$lengths y <- cumsum(rle(y)$lengths) y <- y[seq.int(1L, length(y), 2L)] if (x[[1]] == x[[2]