Is there a way to output the numbers only from a python list?
This should be the most efficient and shortest in Python 2:
import operator
filter(operator.isNumberType, list_1)
This in Python 3:
import numbers
[x for x in list_1 if isinstance(x, numbers.Number)]
List comprehensions.
list_2 = [num for num in list_1 if isinstance(num, (int,float))]