Questions tagged [bins]
235 questions
0
votes
0 answers
pandas value_count function bin order change
I am using value_count and bin to get one view our my database.
bin = np.concatenate((np.arange(0,10,1),np.arange(10,100,10),np.arange(100,1000,100)))
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30,
40, 50, 60, 70, …

Michael Li
- 647
- 2
- 8
- 20
0
votes
1 answer
Apply Bins to Data Frame Groups without making subset Data Frames
I have a data frame containing fish population sampling data. I would like to create bins to count how many fish are in a given length group for each species.
The below code accomplishes this task for 2 species. Doing this for all species in the…

C. Peacock
- 3
- 1
0
votes
2 answers
Python custom aggregates - need a more efficient solution
I'm a new learner to Python and I'm playing with a dataset of interest to help with my learning, in particular trying to get a better understanding of pandas and numpy.
My dataframe has over a million rows and I'm trying to create a custom bucket…

kevo
- 3
- 2
0
votes
4 answers
Trying a function to get data in separate ranges, tally it, and return a list of the tallies
I have been trying to write a function that would take a value from a dictionary, check its range, then tally it in its range. Returning a list of the tallied values.
So given the following dictionary:
data={'P1': {'age': 'eighty two', 'salary':…

Raquel Bisogno
- 41
- 3
0
votes
1 answer
How can I set plot.ly bin for histogram to minutes?
I have a basic histogram chart and need to set xbin to minutes. The examples only show the categorical coordinate strings for months (eg. M1). How do I set it for minutes? Is there a reference to all possibilities? I don't see it on the plot.ly…

scader
- 405
- 3
- 8
- 19
0
votes
1 answer
Binning and making histogram for dates in R
I am new to using dates in R so sorry if this is a basic question. I have a data set that has the name of fracking wells and their job end date as listed below:
df = as.data.frame(df)
head(df)
`WellName …

Mary McCan
- 1
- 1
0
votes
1 answer
building a matrix from results of hist() in R
it is related to this other question:
The dimensions in hist for numpy.histogram with density = True
but there I've been too generic so now I'll go straight to the point:
I have a 633x34 matrix, where every row is a numeric vector like this one:
…

goingdeep
- 99
- 1
- 9
0
votes
0 answers
How to make number of equally sized bins as input for histogram in tableau
I have created a histogram
I am able to give bin size as input parameter
But i want user to input number of bins (x).
Result should have x number of equally sized bins
Please help me with this

manoj rao
- 1
- 1
0
votes
1 answer
grouping bins in a tableau histogram
I have recently started using Tableau. I got a histogram like this:
I want to group the bins after 34000K and make it like "34000k +" as in excel. Please help.

bipvan
- 77
- 7
0
votes
1 answer
SAS create equally spaced bins
I am one variable and the max and min of the variable. How can I create equally spaced 10 bins from min to max? I feel proc rank won't work because I want equally spaced. For example, min=1, max =100, then if a number is 92, then it falls into bin…

user1481397
- 393
- 1
- 9
- 25
0
votes
2 answers
Mean calculation within bins
I am trying to calculate mean within each bin.
Everything works okay, but I get 'nan' mean value in the first bin. I suppose it is not correct. Can you help me to find a mistake?
Here is my code:
data = np.array([-90,-1,2,3,5,6,8,10,121])
bin_s =…

vikkky
- 9
- 2
0
votes
1 answer
Make histograms bars for each label one bar beside another
l would like to make a histogram with bars where each bar is set beside another bar for the same labem.
From the post answered by @ImportanceOfBeingErnest l would like to make histogram with bars where we have a set of labels and two lists. For…

Joseph
- 343
- 6
- 18
0
votes
2 answers
Creating bins in tables
I have a set of data that shows test scores (raw$Score) by year (raw$Year).
I would like to create a table where I see the years as rows and scores in columns and for the scores to be grouped in increments of 5.
When I runtable(raw$Year,raw$Score),…

Danny
- 554
- 1
- 6
- 17
0
votes
2 answers
Create bin column based on two other columns
I need to create a column with bins for which I have found this previous post helpful. However, the bins I want to create, are not simply the grouped intervals of another column, but also need to take factorial data from a second column into…

M.Teich
- 575
- 5
- 22
0
votes
1 answer
R generate bins from a data frame respecting blanks
I need to generate bins from a data.frame based on the values of one column. I have tried the function "cut".
For example: I want to create bins of air temperature values in the column "AirTDay" in a data frame:
AirTDay (oC)
8.16 …

ebb
- 274
- 2
- 6
- 16