quantile Questions
1
Let's say we have this DataFrame:
df = pd.DataFrame(columns=["value"], data=[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 3, 5, 7, 10])
I want to split up the values into 5 bins based on their ...
1
Solved
I just recently came accross that there is different defition of quantile() in Julia and Matlab.
I was unable to align the two definitions and always get different result.
Does anybody know why is ...
Exclamatory asked 10/9, 2023 at 18:42
3
Solved
I am using Pandas to compute some financial risk analytics, including Value at Risk. In short, to compute Value at Risk (VaR), you take a time series of simulated portfolio changes in value, and th...
Lune asked 26/7, 2016 at 17:13
12
Solved
The quantile functions gives us the quantile of a given pandas series s,
E.g.
s.quantile(0.9) is 4.2
Is there the inverse function (i.e. cumulative distribution) which finds the value x such ...
6
Solved
I have a pandas data frame my_df, where I can find the mean(), median(), mode() of a given column:
my_df['field_A'].mean()
my_df['field_A'].median()
my_df['field_A'].mode()
I am wondering is it po...
Tamtam asked 19/9, 2016 at 20:50
4
Solved
I see a lot of questions like this one for R, but I couldn't find one specifically for Python, preferably using numpy.
Let's say I have an array of observations stored in x. I can get the value tha...
3
Solved
I have two columns of data representing the same quantity; one column is from my training data, the other is from my validation data.
I know how to calculate the percentile rankings of the traini...
Antepenult asked 31/3, 2017 at 16:40
2
I have thousands of series (rows of a DataFrame) that I need to apply qcut on. Periodically there will be a series (row) that has fewer values than the desired quantile (say, 1 value vs 2 quantiles...
3
Solved
When using dplyr to create a table of summary statistics that is organized by levels of a variable, I cannot figure out the syntax for calculating quartiles without having to repeat the column name...
4
Solved
I'm currently plotting a number of different distributions of first differences from a number of regression models in ggplot. To facilitate interpretation of the differences, I want to mark the 2.5...
Mireyamiriam asked 1/6, 2015 at 8:29
2
Solved
I have a dfAB
import pandas as pd
import random
A = [ random.randint(0,100) for i in range(10) ]
B = [ random.randint(0,100) for i in range(10) ]
dfAB = pd.DataFrame({ 'A': A, 'B': B })
dfAB
W...
2
I'm working with a data file, the observations inside are random values. In this case I don't know the distribution of x (my observations). I'm using the function density in order to estimate the d...
Integrant asked 21/1, 2013 at 20:22
12
Solved
Is there a convenient way to calculate percentiles for a sequence or single-dimensional numpy array?
I am looking for something similar to Excel's percentile function.
Bichloride asked 3/3, 2010 at 20:21
1
Solved
I currently have a query that works like so:
select AVG(t2 - t1) as delay,
percentile_cont(0.25) within group (order by (t2 - t1)) as q25,
percentile_cont(0.5) within group (order by (t2 - t1)) a...
Secularism asked 16/3, 2021 at 20:1
2
Solved
I need a function like xtile in Stata, that given a vector, it returns which quantile each obs belongs to. So if the function is defined as
function xtile(vector; q= 4) #q = 4 by default returns qu...
2
The following code summarizes numeric data using two different approaches.
The first approach uses the Dataframe().describe() and passes some specific extra percentiles.
The second approach separat...
Divertimento asked 24/6, 2018 at 22:10
7
Solved
I've written a program where the user can enter any number of values into a vector and it's supposed to return the quartiles, but I keep getting a "vector subscript out of range" error :
#include ...
Norite asked 15/8, 2012 at 5:32
2
I'm looking for an efficient quantiles algorithm that allows sample values to be "upserted" or replaced as the value changes over time.
Let's say I have values for items 1-n. I'd like to ...
Brynnbrynna asked 23/6, 2020 at 1:33
2
Solved
require(ggplot2)
require(cowplot)
d = iris
ggplot2::ggplot(d, aes(factor(0), Sepal.Length)) +
geom_violin(fill="black", alpha=0.2, draw_quantiles = c(0.25, 0.5, 0.75)
, colour = "red", size = 1...
Gordie asked 16/3, 2016 at 10:43
2
Solved
I have many scores in the column of an object named example. I want to split these scores into deciles and assign the corresponding decile interval to each row. I tried the following:
import rando...
3
Solved
q <- quantile(faithful$eruptions)
> q
0% 25% 50% 75% 100%
1.60000 2.16275 4.00000 4.45425 5.10000
I get the following result, the dataset is provided in R.
head(faithful)
eruptions wa...
2
Solved
I have read other posts (such as here) on getting the "reverse" of quantile -- that is, to get the percentile that corresponds to a certain value in a series of values.
However, the answers don't...
Putrefaction asked 23/6, 2019 at 13:42
2
I used the quantreg package in R to compute the quantile regression model. In the model, dependent Variable(Y) is NAS_DELAY, and the independent variable(Xs) are SEANSON1TO4, SEANSON2TO4, SEANSON3T...
4
Solved
I'd like to replace all values in my relatively large R dataset which take values above the 95th and below the 5th percentile, with those percentile values respectively. My aim is to avoid simply c...
1
When I run a quantile regression in R, using the quantreg package, and then I run summary(quantregObject), I get this error message:
Error in base::backsolve(r, x, k = k, upper.tri = upper.tri, ...
Wayland asked 8/2, 2015 at 11:1
1 Next >
© 2022 - 2024 — McMap. All rights reserved.