# How can I delete rows from a matrix

I tried very hard to find an answer to a trivial problem: which is to delete the rows with Complex Numbers. I tried the following but none worked for me.

deneme = {{-0.01, .4}, {-0.47, -0.054}, {-0.82, -0.07}, {-1.55, -0.08}, {0.10 + 3.14 I, -0.03}, {-0.54, -0.051}, {0.03, 0.10 + 3.14 I}};
DeleteCases[deneme, {I ..}]
DeleteCases[deneme, {Complex ..}]
Cases[deneme, Cases[deneme, Except@{Complex ..}]]
Pick[deneme, Unitize[Abs[deneme].ConstantArray[1., 2]], 1]


I wonder why it is so difficult to find an answer to this problem.

• Select[deneme, VectorQ[#, Element[#, Reals] &] &] – Alan Dec 17 '19 at 0:51
• @Alan No need VectorQ This is just fine Select[deneme, Element[#, Reals] &] – OkkesDulgerci Dec 17 '19 at 3:12

DeleteCases[deneme, {___, _Complex, ___}]


{{-0.01, 0.4}, {-0.47, -0.054}, {-0.82, -0.07}, {-1.55, -0.08}, {-0.54, -0.051}}

Select[FreeQ[_Complex]] @ deneme


{{-0.01, 0.4}, {-0.47, -0.054}, {-0.82, -0.07}, {-1.55, -0.08}, {-0.54, -0.051}}

Cases[_?(FreeQ[_Complex])]@deneme


{{-0.01, 0.4}, {-0.47, -0.054}, {-0.82, -0.07}, {-1.55, -0.08}, {-0.54, -0.051}}