Questions tagged [bins]
235 questions
0
votes
1 answer
Plot Single Column Data File Histogram in RStudio
How can I display a histogram with 20 bins for the attached file? The two lines of code I attempted to use are shown below.
d=read.table("wgci_mAdc2.csv")
hist(d)
I get an error message which says, "Error in hist.default(d) : 'x' must be numeric"
My…

SpaetzleKing
- 27
- 5
0
votes
0 answers
Why does my finished R histogram not have the amount of bins I specified?
I'm trying to visualize some numerical data to get a sense of how it is distributed, and am trying to graph it as a histogram to do so. However, the resulting histogram only seems to have 2 bins on the graph even when I try to specify more bins.…

wystery
- 9
- 1
0
votes
1 answer
Logistic Regression vs predicting probability by splitting data into bin
So I am exploring using a logistic regression model to predict the probability of a shot resulting in a goal. I have two predictors but for simplicity lets assume I have one predictor: distance from the goal. When doing some data exploration I…

Ian Dragulet
- 23
- 4
0
votes
1 answer
Creating bins based on condition
My original dataset looks like the sample below:
| id | old_a | new_a | old_b | new_b | ratio_a | ratio_b |
|----|-------|-------|-------|-------|----------|---------|
| 1 | 350 | 6 | 35 | 0 | 58.33333 | Inf |
| 2 | 164 | 79 …

hk2
- 487
- 3
- 15
0
votes
1 answer
Systemverilog coverpoint for each element in enum
I am using UVM environment for verification my design. In monitor, I created coverpoints for my design. However, I can not use enums for coverpoint bins.
For each coverpoint, I want to create a bin for each element in enum.
For example,
in…

Burak Toker
- 1
- 1
0
votes
1 answer
Plotly histogram not rendering data correctly
I have a csv that I'm attemping to create a histogram of in plotly. The csv contains a date field (in hour increments), a user count field, and an average connection time field. I am attempting to graph the user count field values across time with…

MapPeddler
- 53
- 9
0
votes
1 answer
Percentage ratio within each bin in stacked histogram
I have a stacked histogram corresponding to three categories (Cat-I, II, III), so that in each bin I can see the frequency of each category. I would prefer to have the Y-axis showing the percentage ratio of each category in each bin so that the…

Hrihaan
- 275
- 5
- 21
0
votes
1 answer
Having issues with pandas histogram. Only one column is showing when bins are set to 4
csv['Followers'] is a column in a pandas df that contains 20k rows of follower count for each tweet collected via twitter API. I am trying to make a histogram separating the data into 4 bins so I can label each row accordingly. However, I am only…

Josh C
- 1
- 1
0
votes
1 answer
How can I create bins with no closed intervals and closed intervals on different sides?
I am new to R and I am trying to create bins, 3 bins to be exact, for data that I have to sort. I need the first bin to collect values on the interval (-inf, -3] and be called "Improved", the second bin to collect values on the interval (-3, 3) and…
0
votes
2 answers
How to draw a histogram of bins of the same width and different height in a certain interval?
I have an interval 0.0..1.0 and heights of 10 bins inside it, for example:
[0.1, 0.2, 0.3, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]
How can I render a histogram of these bins with the same width using Matplotlib?

Commander Tvis
- 2,244
- 2
- 15
- 41
0
votes
2 answers
R: Retrieving participant scores from another table based on birth dates
I have two tables: One with participants and one with an encoding of scores based on birth dates.
The score table looks like this:
score_table
Key | Value
--------------------
01/01/1900 | 15
01/01/1940 | 25
01/01/1950 | 30
All…

MilanV
- 72
- 6
0
votes
1 answer
Histogram not specifying desired bins in pandas
Code:
np.histogram(df['columnforhistogram'], bins=(np.arange(start=0, stop=2000, step=25)), density=True)
plt.xlabel("Column")
plt.ylabel('Bins')
plt.show()
Output I want:
I want a histogram with bins starting from 0 , ending at 2000 and at an…

noob
- 3,601
- 6
- 27
- 73
0
votes
2 answers
Creating Bin for timestamp column
I am trying to create a proper bin for a timestamp interval column,
using code such as
df['Bin'] = pd.cut(df['interval_length'], bins=pd.to_timedelta(['00:00:00','00:10:00','00:20:00','00:30:00','00:40:00','00:50:00','00:60:00']))
The Resulting df…

Chris90
- 1,868
- 5
- 20
- 42
0
votes
1 answer
How to use pd.qcut in python to decile column for column values > 0
Column contains following data (Data has been sorted in descending order of this column). There are two million records in this column and about one million are zeros. The distribution of this column is as follows
Column Distribution
min 0
mean…
0
votes
1 answer
Optimize distributions in bucketing bins in python
I have a bucketing bin problem I'd like to solve for in Python and curious if anyone has ideas on best approaches (or existing packages). I have a population where I'd like to create 10 bins for. The population has a score and has been segmented…

Timmy
- 21
- 2