4 updated benchmarks and added a conclusion
source | link

Here is a fast version:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mr.Wizard's benchmarking code:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

(*jjc385*) Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

(*Mr.Wizard*) getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
    getReal[big] // Length // RepeatedTiming

(*UnchartedWorks*) (big // Select[# ∈ Reals &]) // Length // RepeatedTiming

(*KraZug*) Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.016, 5000}

{0.0085, 5000}

{0.0084, 5000}

{0.0076, 5000}

This method is about 7 times faster:

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Update: benchmarks of updated method of Mr. Wizard

For pure numerical data (which can be converted to PackedArray), Mr. Wizard's method is twice faster than mine:

(*Mr.Wizard*)
Developer`ToPackedArray[getReal[Developer`ToPackedArray[big, Complex]], Real] // Length // RepeatedTiming

{0.00055, 5000}

For data which are already in complex PackedArray form, Mr. Wizard's results are 5 times faster:

(*Mr.Wizard*)
big2 = Developer`ToPackedArray[big, Complex];
Developer`ToPackedArray[getReal[big2], Real] // Length // RepeatedTiming

{0.00021, 5000}

Conclusion

Which filtering method is the fastest depends on the contents of your data.

If there are symbols (e.g. Missing) inside your data, then my solution is faster.

If data consists only from numbers (as in your example), it is faster to convert it to the PackedArray form and use Mr.Wizards solution.

Here is a fast version:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mr.Wizard's benchmarking code:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

(*jjc385*) Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

(*Mr.Wizard*) getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
    getReal[big] // Length // RepeatedTiming

(*UnchartedWorks*) (big // Select[# ∈ Reals &]) // Length // RepeatedTiming

(*KraZug*) Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.016, 5000}

{0.0085, 5000}

{0.0084, 5000}

{0.0076, 5000}

This method is about 7 times faster:

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Here is a fast version:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mr.Wizard's benchmarking code:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

(*jjc385*) Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

(*Mr.Wizard*) getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
    getReal[big] // Length // RepeatedTiming

(*UnchartedWorks*) (big // Select[# ∈ Reals &]) // Length // RepeatedTiming

(*KraZug*) Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.016, 5000}

{0.0085, 5000}

{0.0084, 5000}

{0.0076, 5000}

This method is about 7 times faster:

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Update: benchmarks of updated method of Mr. Wizard

For pure numerical data (which can be converted to PackedArray), Mr. Wizard's method is twice faster than mine:

(*Mr.Wizard*)
Developer`ToPackedArray[getReal[Developer`ToPackedArray[big, Complex]], Real] // Length // RepeatedTiming

{0.00055, 5000}

For data which are already in complex PackedArray form, Mr. Wizard's results are 5 times faster:

(*Mr.Wizard*)
big2 = Developer`ToPackedArray[big, Complex];
Developer`ToPackedArray[getReal[big2], Real] // Length // RepeatedTiming

{0.00021, 5000}

Conclusion

Which filtering method is the fastest depends on the contents of your data.

If there are symbols (e.g. Missing) inside your data, then my solution is faster.

If data consists only from numbers (as in your example), it is faster to convert it to the PackedArray form and use Mr.Wizards solution.

3 Improved formatting
source | link

Here is a fast version. It is about 7 times faster than Select[FreeQ[Complex]]:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mathematica 11.1.1 and benchmark data from Mr.Wizard's answerbenchmarking code:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

jjc385:


(*jjc385*) Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

{0.016, 5000}

Mr.Wizard:


(*Mr.Wizard*) getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
    getReal[big] // Length // RepeatedTiming

{0.0085, 5000}

UnchartedWorks:

 
(*UnchartedWorks*) (big // Select[# ∈ Reals &]) // Length // RepeatedTiming

{0.0084, 5000}

KraZug:


(*KraZug*) Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.016, 5000}

{0.0085, 5000}

{0.0084, 5000}

{0.0076, 5000}

This method (aboutis about 7 times faster):

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Here is a fast version. It is about 7 times faster than Select[FreeQ[Complex]]:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mathematica 11.1.1 and benchmark data from Mr.Wizard's answer:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

jjc385:

Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

{0.016, 5000}

Mr.Wizard:

getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
getReal[big] // Length // RepeatedTiming

{0.0085, 5000}

UnchartedWorks:

(big // Select[# ∈ Reals &]) // Length // RepeatedTiming

{0.0084, 5000}

KraZug:

Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.0076, 5000}

This method (about 7 times faster):

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Here is a fast version:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mr.Wizard's benchmarking code:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

(*jjc385*) Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

(*Mr.Wizard*) getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
    getReal[big] // Length // RepeatedTiming
 
(*UnchartedWorks*) (big // Select[# ∈ Reals &]) // Length // RepeatedTiming

(*KraZug*) Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.016, 5000}

{0.0085, 5000}

{0.0084, 5000}

{0.0076, 5000}

This method is about 7 times faster:

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

2 added 70 characters in body
source | link

Here is the fastesta fast version I could find. It is about 7 times faster than Select[FreeQ[Complex]]:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mathematica 11.1.1 and benchmark data from Mr.Wizard's answer:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

jjc385:

Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

{0.016, 5000}

Mr.Wizard:

getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
getReal[big] // Length // RepeatedTiming

{0.0085, 5000}

UnchartedWorks:

(big // Select[# ∈ Reals &]) // Length // RepeatedTiming

{0.0084, 5000}

KraZug:

Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.0076, 5000}

thisThis method is about(about 7 times faster):

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Here is the fastest version I could find:

Cases[data, {_Real | _Integer, _Real | _Integer}]

Benchmark

Using Mathematica 11.1.1 and benchmark data from Mr.Wizard's answer:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

jjc385:

Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

{0.016, 5000}

Mr.Wizard:

getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
getReal[big] // Length // RepeatedTiming

{0.0085, 5000}

UnchartedWorks:

(big // Select[# ∈ Reals &]) // Length // RepeatedTiming

{0.0084, 5000}

KraZug:

Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.0076, 5000}

this method is about 7 times faster:

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

Here is a fast version. It is about 7 times faster than Select[FreeQ[Complex]]:

Cases[data, {_Real | _Integer, _Real | _Integer}]

{{1, 3}, {-5, 0}, {3, 6}}

Benchmark

Using Mathematica 11.1.1 and benchmark data from Mr.Wizard's answer:

big = Join[RandomReal[{-9, 9}, {5000, 2}], 
    RandomComplex[{-2 - I, 5 + 3 I}, {3000, 2}]] // RandomSample;

jjc385:

Select[big, And @@ Internal`RealValuedNumberQ /@ # &] // Length // RepeatedTiming

{0.016, 5000}

Mr.Wizard:

getReal = Pick[#, Unitize[Abs@Im@#.{1, 1}], 0] &;
getReal[big] // Length // RepeatedTiming

{0.0085, 5000}

UnchartedWorks:

(big // Select[# ∈ Reals &]) // Length // RepeatedTiming

{0.0084, 5000}

KraZug:

Select[big, FreeQ[#, Complex] &] // Length // RepeatedTiming

{0.0076, 5000}

This method (about 7 times faster):

Cases[big, {_Real | _Integer, _Real | _Integer}] // Length // RepeatedTiming

{0.00109, 5000}

1
source | link