Closed robertmetcalf closed 4 years ago
Sorry for the long response time and thanks for the example repo!
I don't think you have an error with your code and I think it's normal that the value 0 can be present twice in the class bounds that are returned.
The values you get should read as follows:
Interval |
---|
[0.0, 0.0] |
(0.0, 10435.0] |
(10435.0, 11643.0] |
(11643.0, 12476.0] |
(12476.0, 13337.0] |
(13337.0, 16116.0] |
(16116.0, 27125.0] |
This means that the first class contains all the zeros and the second class contains values greater than 0.0 up to and including the value 10435.0 (values in the second class are > 0
and <= 10435.0
).
Seems to make sense given the distribution of your values.
Thank you for the clarification, much appreciated. I didn't full understand how the class boundaries worked. My code fix will be easy. Again, excellent resolution and explanation.
Description
I have a data set that I break into 7 bins. The results include the zero value, twice. Here is an example.
If the data is broken into 6 bins it works. Here is the output.
I created a GitHub repo with a test Python file and the CSV data.
I presume it's a problem in my code but I can't spot it.