So I have a dataframe that looks like this:

```
           x   y
1      (0,4]   1
2      (0,4]   2
3      (0,4]   3
4      (0,4]   4
5      (4,5]   5
6     (5,10]   6
7     (5,10]   7
8     (5,10]   8
9     (5,10]   9
10    (5,10]  10
11   (10,20]  11
12   (10,20]  12
13   (10,20]  13
14   (10,20]  14
15   (10,20]  15
16   (10,20]  16
17   (10,20]  17
18   (10,20]  18
19   (10,20]  19
20   (10,20]  20
21   (20,40]  21
22   (20,40]  22
23   (20,40]  23
24   (20,40]  24
25   (20,40]  25
26   (20,40]  26
27   (20,40]  27
28   (20,40]  28
29   (20,40]  29
30   (20,40]  30

```

And I want to partition the Y column by the irregular partitions that have categorised the x column, without going through and hard coding each specific cut off point. Is there a way of doing this?

Thanks in advance

Edit: hoped for output

```
         x       y
1    (0,4]   (0,4]
2    (0,4]   (0,4]
3    (0,4]   (0,4]
4    (0,4]   (0,4]
5    (4,5]   (4,5]
6   (5,10]  (5,10]
7   (5,10]  (5,10]
8   (5,10]  (5,10]
9   (5,10]  (5,10]
10  (5,10]  (5,10]
11 (10,20] (10,20]
12 (10,20] (10,20]
13 (10,20] (10,20]
14 (10,20] (10,20]
15 (10,20] (10,20]
16 (10,20] (10,20]
17 (10,20] (10,20]
18 (10,20] (10,20]
19 (10,20] (10,20]
20 (10,20] (10,20]
21 (20,40] (20,40]
22 (20,40] (20,40]
23 (20,40] (20,40]
24 (20,40] (20,40]
25 (20,40] (20,40]
26 (20,40] (20,40]
27 (20,40] (20,40]
28 (20,40] (20,40]
29 (20,40] (20,40]
30 (20,40] (20,40]

```