Automatically find a threshold on 1d data I have values a set of values that are plotted on the image (I sorted them for the convinience). I need to group them in two group: the ones that are around zero (purple ones) and the rest (red ones). Does it make sense to apply clustering here? What are the other methods that could be applied here to separate these two groups of points? Note, that the purple group is not exactly zero and can vary a bit around zero while the red group can take values up to 1.

Data:
id, value
1, 0.01
2, 0.43
3, 0.52
4, 0.95
5, 0.00
6, -0.03
7, 0.23
8, 0.29
9, 0.32
10, -0.01
11, 0.29
12, 0.19
13, 0.35
14, 0.18
15, 0.02
16, 0.00
17, 0.05
18, 0.28
19, 0.31
20, 0.36
21, 0.22
22, 0.31
23, 0.44
24, 0.51

 A: Detecting Level Shifts https://www.jstor.org/stable/2287980?seq=1#page_scan_tab_contents AND http://docplayer.net/12080848-Outliers-level-shifts-and-variance-changes-in-time-series.html in a time series requires incorporating ARIMA structure . It is essentially 1 dimensional cluster analysis. If you post a REAL data set I might be able to help further .
EDITED AFTER RECEIPT OF DATA:
I took your 24 values and pre-sorted them from low to high and submitted them to AUTOBOX a piece of software that I have helped develop that detects level shifts using Intervention Detection which is equivalent to detecting mean shifts. I specified that this was NOT time series data via a control file. AUTOBOX requires either an implicit or explicit count for the minimum count in any 1 group. I used the default of 4 for the sample size of 20. To detect level shifts one also needs to detect pulses (one period outliers) which otherwise can confuse level shift detection. The results are here in the equation   suggesting three groupings 1-11 ; 12-19 and 20-24 with 1 anomly (outlier) at observation 24. Graphically the actual and the fitted values show the suggested groupings  . Clearly the forecast is inapplicable to your problem/circumstance but the discriminatory capabilities are I believe what you may be trying to accomplish.
This little example of taking a time series package and constraining it to not do any time-adaptive modeliing illustrates how cross-sectional data is a subset of time series.
There is another feature where the user can optionally pre-specify the minumum difference in means that will trigger a positive conclusion about a level shift (mean change) . In that way a user can require a new group to have a difference in the means to be at least equal to or greater than a preset value.
