# Conflict in deleting because of some digits [closed]

I have a list at 3dplot and I want to have a list the second element of which be equal to 0.2

sELECTdplot= Select[3dplot, (#[[2]] == 0.20 &)]
(***
{{0., 0.2, -0.0793037}, {0.2, 0.2, -0.0903679}, {0.4,
0.2, -0.100867}, {0.6, 0.2, -0.111708}, {0.8, 0.2, -0.123335}, {1.,
0.2, -0.135819}, {1.2, 0.2, -0.148896}, {1.4, 0.2, -0.162047}, {1.6,
0.2, -0.174654}, {1.8, 0.2, -0.186165}, {2., 0.2, -0.196225}}
**)


and after that I want to delete the second element of any sublist (removing 0.2 from all elements) for this reason I have used of

dELETTED= DeleteCases[sELECTdplot, 0.2, Infinity]
(***{{0., 0.2, -0.0793037}, {0.2, -0.0903679}, {0.4,
0.2, -0.100867}, {0.6, 0.2, -0.111708}, {0.8, 0.2, -0.123335}, {1.,
0.2, -0.135819}, {1.2, 0.2, -0.148896}, {1.4, 0.2, -0.162047}, {1.6,
0.2, -0.174654}, {1.8, 0.2, -0.186165}, {2., 0.2, -0.196225}}**)


Deleting just happened for {0.2, -0.0903679} the second element. it is because of when I copy one of 0.2s in the sELECTdplot they are originally are 0.20000000000000004. How can I get rid of this annoying case?! Also I cannot understand why must we use of Infinity in the DeleteCases. Without this we cannot reach to a desired result.

• The Infinity is necessary because DeleteCases operates on Level 1, by default (i.e. it's checking to see if each of the lists is equal to 0.2, which clearly isn't the case). You could also do DeleteCases[sELECTdplot, 0.2, {2}], because the third argument forces DeleteCases to look at the quantities at Level 2, which are all of the numbers in the 3-element lists. – march Feb 26 '16 at 7:27
• @Ackaran - I don't understand how you have defined a variable as 3dplot? In your data file you have 3dplot = ...... which of course gives an error because variables can't begin with numbers. – Jason B. Feb 26 '16 at 8:11
• I understood this error, I could not remove that – Unbelievable Feb 26 '16 at 8:17
• 3dplotwill be interpreted as 3*dplot. As stated by @JasonB, you can simply remove the second column, without any need for matching. – Yves Klett Feb 26 '16 at 8:21

There is no reason to use DeleteCases here, you can use Part to remove the middle column.
Select[dplot, (#[[2]] == 0.20 &)][[All, {1, 3}]]