I have a data
data={{{-(1/2), -(3/2)}, {1/2, -(1/2)}, {3/2, 1/
2}}, {{-(3/2), -(5/2)}, {-(1/2), -(3/2)}, {1/2, -(1/2)}, {3/2, 1/
2}, {5/2, 3/2}}}
I want to change this data to this

Inorder solve this ploblem I can use
TreeForm@data
get this
By looking at the data, I found that the second part lsit should be deleted

I want to get rid of all the parentheses here
I tried a lot of things to no avail, so I finally asked "chatgpt"
Flatten[data, {{1}, {2, 3}}]
The problem is solved, but I don't understand how to use the "layer number" in Flatten, I'm confused



Flattenleft layer (aka level) 1 alone and flattened layers 2 and 3. (You have layer 3 outlined in the red box. Everything below it was put into layer two, divided according to layer 2.) – Michael E2 Mar 27 '23 at 13:49Flatten[data, {{1, 3}, {2}}], which might be the code you desire. – Michael E2 Mar 27 '23 at 13:58Flattenin this site. If you still feel confused, please clarify which part you're having difficulty. – xzczd Mar 27 '23 at 14:16Assumptionsoption to integral, but I still want to use the pretty 2D∫. " <- This is just impossible, to setAssumptionsyou have to use the 1DIntegrate[…]– xzczd Mar 27 '23 at 14:27Flatten, the document states: Flatten[list, {{$s_{11}$, $s_{12}$, …}, {$s_{21}$, $s_{22}$, …}, …}] flattens list by combining all levels $\color{red}{s_{ij}}$ to make each level $i$ in the result. It uses "corner notation", too. – xzczd Mar 27 '23 at 14:52