# Dimension change when removing element

I have a list of 3d coordinates.

data = {{1., 2., 3.}, {2., 3., 4.}, {4., 5., 6.}, {6., 7., 8.}, {8.,
9., 10.}};
Dimensions[data]
data[[All, 2]] = data[[All, 2]]*0;
data
Dimensions[data]
data = DeleteCases[data, 0., 2]
Dimensions[data]

{5, 3}
{{1., 0., 3.}, {2., 0., 4.}, {4., 0., 6.}, {6., 0., 8.}, {8., 0., 10.}}
{5, 3}
{{1., 3.}, {2., 4.}, {4., 6.}, {6., 8.}, {8., 10.}}
{5, 2}


The code abode does as expected it reduces the dimensions from {5,3}->{5,2} I tried the same code on a larger array, dimensions then go from {11698,3} -> {11698}. The elements are still {x,z} if one calls LargeArray[[1]] one get a list of two elements. However mathematica treats its as on entity. This causes the data to not be interpreted right in a ListPLot call. Any thought on why this is happening?

• I'm guessing that the array became ragged and not all sublists have the same length any more. E.g., Dimensions[{{1, 2}, {1}, {1, 3}}] === {3}. Try Counts[Length /@ LargeArray] and see how many different lengths there are in your array. – Sjoerd Smit Sep 12 '18 at 14:31
• That actually might be it, I didnt take into account that if either x or z is 0. it get deleted creating list with just one or zero elements. – Giovanni Baez Sep 12 '18 at 14:37

data[[All, {1, 3}]]